Use a feature flag to decide whether logs should be printed to logcat or not

This is done so it can be temporarily enabled on release builds for quick debugging sessions, then disabled again.
This commit is contained in:
Jorge Martín 2025-03-13 16:11:21 +01:00
parent b73c447808
commit f01078bc8a
3 changed files with 16 additions and 1 deletions

View file

@ -168,4 +168,14 @@ enum class FeatureFlags(
defaultValue = { true },
isFinished = false,
),
PrintLogsToLogcat(
key = "feature.print_logs_to_logcat",
title = "Print logs to logcat",
description = "Print logs to logcat in addition to log files. Requires an app restart to take effect." +
"\n\nWARNING: this will make the logs visible in the device logs and may affect performance. " +
"It's not intended for daily usage in release builds.",
defaultValue = { buildMeta -> buildMeta.buildType != BuildType.RELEASE },
// False so it's displayed in the developer options screen
isFinished = false,
)
}