Fix critical bug with the logger crashing the app
This commit is contained in:
parent
3266b7408c
commit
4e11467a10
@ -7,6 +7,10 @@ patch-level version changes can be found in [commit messages](../../commits/mast
|
|||||||
## Next_Ver
|
## Next_Ver
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
## 20250217
|
||||||
|
|
||||||
|
- Fix critical bug with the logger crashing the app
|
||||||
|
|
||||||
## 20250209
|
## 20250209
|
||||||
|
|
||||||
- Update dependency versions
|
- Update dependency versions
|
||||||
|
@ -48,8 +48,8 @@ android {
|
|||||||
applicationId = "com.fredhappyface.ewesticker"
|
applicationId = "com.fredhappyface.ewesticker"
|
||||||
minSdk = 26
|
minSdk = 26
|
||||||
targetSdk = 35
|
targetSdk = 35
|
||||||
versionCode = 20250209
|
versionCode = 20250217
|
||||||
versionName = "20250209"
|
versionName = "20250217"
|
||||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||||
setProperty("archivesBaseName", "$applicationId-$versionName")
|
setProperty("archivesBaseName", "$applicationId-$versionName")
|
||||||
}
|
}
|
||||||
|
@ -35,6 +35,7 @@ import com.fredhappyface.ewesticker.utilities.Cache
|
|||||||
import com.fredhappyface.ewesticker.utilities.StickerClickListener
|
import com.fredhappyface.ewesticker.utilities.StickerClickListener
|
||||||
import com.fredhappyface.ewesticker.utilities.StickerSender
|
import com.fredhappyface.ewesticker.utilities.StickerSender
|
||||||
import com.fredhappyface.ewesticker.utilities.Toaster
|
import com.fredhappyface.ewesticker.utilities.Toaster
|
||||||
|
import com.fredhappyface.ewesticker.utilities.startLogger
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import kotlin.math.abs
|
import kotlin.math.abs
|
||||||
import kotlin.math.min
|
import kotlin.math.min
|
||||||
@ -96,6 +97,7 @@ class ImageKeyboard : InputMethodService(), StickerClickListener {
|
|||||||
override fun onCreate() {
|
override fun onCreate() {
|
||||||
// Misc
|
// Misc
|
||||||
super.onCreate()
|
super.onCreate()
|
||||||
|
startLogger(filesDir)
|
||||||
|
|
||||||
XLog.i("=".repeat(80))
|
XLog.i("=".repeat(80))
|
||||||
XLog.i("Loaded $packageName:${javaClass.name}")
|
XLog.i("Loaded $packageName:${javaClass.name}")
|
||||||
|
@ -17,14 +17,10 @@ import androidx.activity.result.contract.ActivityResultContracts
|
|||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
import androidx.preference.PreferenceManager
|
import androidx.preference.PreferenceManager
|
||||||
import com.elvishew.xlog.LogConfiguration
|
|
||||||
import com.elvishew.xlog.LogLevel
|
|
||||||
import com.elvishew.xlog.XLog
|
import com.elvishew.xlog.XLog
|
||||||
import com.elvishew.xlog.printer.AndroidPrinter
|
|
||||||
import com.elvishew.xlog.printer.file.FilePrinter
|
|
||||||
import com.elvishew.xlog.printer.file.naming.DateFileNameGenerator
|
|
||||||
import com.fredhappyface.ewesticker.utilities.StickerImporter
|
import com.fredhappyface.ewesticker.utilities.StickerImporter
|
||||||
import com.fredhappyface.ewesticker.utilities.Toaster
|
import com.fredhappyface.ewesticker.utilities.Toaster
|
||||||
|
import com.fredhappyface.ewesticker.utilities.startLogger
|
||||||
import com.google.android.material.progressindicator.LinearProgressIndicator
|
import com.google.android.material.progressindicator.LinearProgressIndicator
|
||||||
import io.noties.markwon.Markwon
|
import io.noties.markwon.Markwon
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
@ -54,14 +50,7 @@ class MainActivity : AppCompatActivity() {
|
|||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
setContentView(R.layout.activity_main)
|
setContentView(R.layout.activity_main)
|
||||||
|
|
||||||
val logConfig = LogConfiguration.Builder().logLevel(LogLevel.ALL).tag("EweSticker").build()
|
startLogger(filesDir)
|
||||||
val androidPrinter =
|
|
||||||
AndroidPrinter(true) // Printer that print the log using android.util.Log
|
|
||||||
val filePrinter = FilePrinter.Builder(
|
|
||||||
File(filesDir, "logs").path
|
|
||||||
).fileNameGenerator(DateFileNameGenerator()).build()
|
|
||||||
|
|
||||||
XLog.init(logConfig, androidPrinter, filePrinter)
|
|
||||||
|
|
||||||
XLog.i("=".repeat(80))
|
XLog.i("=".repeat(80))
|
||||||
XLog.i("Loaded $packageName:$localClassName")
|
XLog.i("Loaded $packageName:$localClassName")
|
||||||
|
@ -0,0 +1,28 @@
|
|||||||
|
package com.fredhappyface.ewesticker.utilities
|
||||||
|
|
||||||
|
import com.elvishew.xlog.LogConfiguration
|
||||||
|
import com.elvishew.xlog.LogLevel
|
||||||
|
import com.elvishew.xlog.printer.AndroidPrinter
|
||||||
|
import com.elvishew.xlog.printer.file.FilePrinter
|
||||||
|
import com.elvishew.xlog.printer.file.naming.DateFileNameGenerator
|
||||||
|
import java.io.File
|
||||||
|
import com.elvishew.xlog.XLog
|
||||||
|
|
||||||
|
|
||||||
|
fun startLogger(filesDir: File) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
XLog.i("startLogger if not already started")
|
||||||
|
} catch (e: IllegalStateException) {
|
||||||
|
|
||||||
|
val logConfig = LogConfiguration.Builder().logLevel(LogLevel.ALL).tag("EweSticker").build()
|
||||||
|
val androidPrinter =
|
||||||
|
AndroidPrinter(true) // Printer that print the log using android.util.Log
|
||||||
|
val filePrinter = FilePrinter.Builder(
|
||||||
|
File(filesDir, "logs").path
|
||||||
|
).fileNameGenerator(DateFileNameGenerator()).build()
|
||||||
|
|
||||||
|
XLog.init(logConfig, androidPrinter, filePrinter)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
4
metadata/en-US/changelogs/20250217.txt
Normal file
4
metadata/en-US/changelogs/20250217.txt
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<h2 id="section">20250217</h2>
|
||||||
|
<ul>
|
||||||
|
<li>Fix critical bug with the logger crashing the app</li>
|
||||||
|
</ul>
|
Loading…
x
Reference in New Issue
Block a user