Add setting to increase logging verbosity (#354)

Adds a toggle to increase the verbosity of the app logs for
release/production builds

Most users won't need to use this, but it can be helpful when [gathering
app
logs](https://github.com/damontecres/Wholphin/wiki/Gathering-app-logs)
to report an issue.
This commit is contained in:
damontecres 2025-11-30 17:27:41 -05:00 committed by GitHub
parent a320875af6
commit eca3268a7d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 65 additions and 0 deletions

View file

@ -13,6 +13,7 @@ import com.github.damontecres.wholphin.ui.preferences.ConditionalPreferences
import com.github.damontecres.wholphin.ui.preferences.PreferenceGroup
import com.github.damontecres.wholphin.ui.preferences.PreferenceScreenOption
import com.github.damontecres.wholphin.ui.preferences.PreferenceValidation
import com.github.damontecres.wholphin.util.DebugLogTree
import kotlin.time.Duration.Companion.hours
import kotlin.time.Duration.Companion.milliseconds
import kotlin.time.Duration.Companion.minutes
@ -699,6 +700,19 @@ sealed interface AppPreference<T> {
},
summary = R.string.disable_if_crash,
)
val DebugLogging =
AppSwitchPreference(
title = R.string.verbose_logging,
defaultValue = false,
getter = { DebugLogTree.INSTANCE.enabled },
setter = { prefs, value ->
DebugLogTree.INSTANCE.enabled = value
prefs.update { debugLogging = value }
},
summaryOn = R.string.enabled,
summaryOff = R.string.disabled,
)
}
}
@ -837,6 +851,7 @@ val advancedPreferences =
listOf(
AppPreference.SendAppLogs,
AppPreference.SendCrashReports,
AppPreference.DebugLogging,
AppPreference.ClearImageCache,
AppPreference.OssLicenseInfo,
),

View file

@ -20,6 +20,8 @@ class AppPreferencesSerializer
.apply {
updateUrl = AppPreference.UpdateUrl.defaultValue
autoCheckForUpdates = AppPreference.AutoCheckForUpdates.defaultValue
sendCrashReports = AppPreference.SendCrashReports.defaultValue
debugLogging = AppPreference.DebugLogging.defaultValue
playbackPreferences =
PlaybackPreferences