Enable logcat logging on stable and debug builds without enabling verbose logging (mihonapp/mihon#2836)

(cherry picked from commit a4f5a8184c956a3d92183e52a1c96d786cfe9517)
This commit is contained in:
NGB-Was-Taken 2026-01-07 22:07:52 +05:45 committed by Cuong-Tran
parent cfa624811a
commit 58d1bf34d3
2 changed files with 15 additions and 6 deletions

View file

@ -31,6 +31,9 @@ The format is a modified version of [Keep a Changelog](https://keepachangelog.co
- Fix pre-1970 upload date display in chapter list ([@MajorTanya](https://github.com/MajorTanya)) ([#2779](https://github.com/mihonapp/mihon/pull/2779))
- Fix crash when trying to install/update extensions while shizuku is not running ([@NGB-Was-Taken](https://github.com/NGB-Was-Taken)) ([#2837](https://github.com/mihonapp/mihon/pull/2837))
### Other
- Enable logcat logging on stable and debug builds without enabling verbose logging ([@NGB-Was-Taken](https://github.com/NGB-Was-Taken)) ([#2836](https://github.com/mihonapp/mihon/pull/2836))
## [v0.19.3] - 2025-11-07
### Improved
- Improved various aspects of the WebView multi window support ([@TheUnlocked](https://github.com/TheUnlocked)) ([#2662](https://github.com/mihonapp/mihon/pull/2662))

View file

@ -80,6 +80,7 @@ import exh.log.xLogD
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
import logcat.AndroidLogcatLogger
import logcat.LogPriority
import logcat.LogcatLogger
import mihon.core.migration.Migrator
@ -148,9 +149,6 @@ class App : Application(), DefaultLifecycleObserver, SingletonImageLoader.Factor
Injekt.importModule(KMKDomainModule())
// KMK <--
setupExhLogging() // EXH logging
LogcatLogger.install(XLogLogcatLogger()) // SY Redirect Logcat to XLog
setupNotificationChannels()
ProcessLifecycleOwner.get().lifecycle.addObserver(this)
@ -215,9 +213,17 @@ class App : Application(), DefaultLifecycleObserver, SingletonImageLoader.Factor
// Updates widget update
WidgetManager(Injekt.get(), Injekt.get()).apply { init(scope) }
/*if (!LogcatLogger.isInstalled && networkPreferences.verboseLogging().get()) {
LogcatLogger.install(AndroidLogcatLogger(LogPriority.VERBOSE))
}*/
setupExhLogging() // EXH logging
if (!LogcatLogger.isInstalled) {
val minLogPriority = when {
networkPreferences.verboseLogging().get() -> LogPriority.VERBOSE
BuildConfig.DEBUG -> LogPriority.DEBUG
else -> LogPriority.INFO
}
LogcatLogger.install()
LogcatLogger.loggers += XLogLogcatLogger() // SY Redirect Logcat to XLog
LogcatLogger.loggers += AndroidLogcatLogger(minLogPriority)
}
if (!WorkManager.isInitialized()) {
WorkManager.initialize(this, Configuration.Builder().build())