refactor: update log usages

This commit is contained in:
Acclorite 2025-06-03 09:52:41 +03:00
parent d1b7376633
commit 731329879d
No known key found for this signature in database
GPG key ID: 6E54C611F6EE8593
3 changed files with 4 additions and 16 deletions

View file

@ -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 {

View file

@ -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].
*

View file

@ -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") +