refactor: update log usages
This commit is contained in:
parent
d1b7376633
commit
731329879d
3 changed files with 4 additions and 16 deletions
|
|
@ -9,12 +9,10 @@ package ua.acclorite.book_story.core.crash
|
|||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Process
|
||||
import android.util.Log
|
||||
import ua.acclorite.book_story.core.logE
|
||||
import ua.acclorite.book_story.presentation.crash.CrashActivity
|
||||
import kotlin.system.exitProcess
|
||||
|
||||
private const val CRASH_TAG = "CRASH, APP"
|
||||
|
||||
class CrashHandler(
|
||||
private val context: Context
|
||||
) : Thread.UncaughtExceptionHandler {
|
||||
|
|
@ -22,7 +20,7 @@ class CrashHandler(
|
|||
override fun uncaughtException(thread: Thread, throwable: Throwable) {
|
||||
val crashLog = throwable.stackTraceToString()
|
||||
|
||||
Log.e(CRASH_TAG, crashLog)
|
||||
logE(crashLog)
|
||||
if (!CrashUtils.saveCrashLog(context, crashLog)) return
|
||||
|
||||
val intent = Intent(context, CrashActivity::class.java).apply {
|
||||
|
|
|
|||
|
|
@ -64,13 +64,6 @@ enum class Theme(
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Converting [String] into [Theme].
|
||||
*/
|
||||
fun String.toTheme(): Theme {
|
||||
return Theme.valueOf(this)
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a colorscheme based on [Theme].
|
||||
*
|
||||
|
|
|
|||
|
|
@ -8,12 +8,10 @@
|
|||
|
||||
package ua.acclorite.book_story.ui.theme
|
||||
|
||||
import android.util.Log
|
||||
import androidx.compose.material3.ColorScheme
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.toArgb
|
||||
|
||||
private const val THEME = "THEME"
|
||||
import ua.acclorite.book_story.core.logD
|
||||
|
||||
/**
|
||||
* This function logs all the colors of the colorScheme.
|
||||
|
|
@ -33,8 +31,7 @@ fun ColorScheme.logTheme(darkTheme: Boolean): ColorScheme {
|
|||
return "private val $variableName$suffix = Color(0x${this.convertToHex()})\n"
|
||||
}
|
||||
|
||||
Log.i(
|
||||
THEME,
|
||||
logD(
|
||||
"Theme $suffix:\n" +
|
||||
"------------------------\n" +
|
||||
primary.convertToVal("primary") +
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue