diff --git a/CHANGELOG.md b/CHANGELOG.md index 947617ddf..caf33bc36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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)) diff --git a/app/src/main/java/eu/kanade/tachiyomi/App.kt b/app/src/main/java/eu/kanade/tachiyomi/App.kt index 6c60663ae..6cc171b6b 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/App.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/App.kt @@ -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())