diff options
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/utils/L.kt')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/utils/L.kt | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/utils/L.kt b/app/src/main/kotlin/com/pitchedapps/frost/utils/L.kt index 389cb6b7..974047e8 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/utils/L.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/L.kt @@ -16,7 +16,6 @@ */ package com.pitchedapps.frost.utils -import android.util.Log import ca.allanwang.kau.logging.KauLogger import ca.allanwang.kau.logging.KauLoggerExtension import com.bugsnag.android.Bugsnag @@ -27,13 +26,7 @@ import com.pitchedapps.frost.BuildConfig * * Logging for frost */ -object L : KauLogger("Frost", { - when (it) { - Log.VERBOSE -> BuildConfig.DEBUG - Log.INFO, Log.ERROR -> true - else -> BuildConfig.DEBUG || Prefs.verboseLogging - } -}) { +object L : KauLogger("Frost") { inline fun test(message: () -> Any?) { _d { @@ -59,7 +52,7 @@ object L : KauLogger("Frost", { } } - var bugsnagInit = false + var hasAnalytics: () -> Boolean = { false } override fun logImpl(priority: Int, message: String?, t: Throwable?) { /* @@ -67,7 +60,7 @@ object L : KauLogger("Frost", { * bugsnagInit is changed per application and helps prevent crashes (if calling pre init) * analytics is changed by the user, and may be toggled throughout the app */ - if (BuildConfig.DEBUG || !bugsnagInit || !Prefs.analytics) { + if (BuildConfig.DEBUG || !hasAnalytics()) { super.logImpl(priority, message, t) } else { if (message != null) { |