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 | 10 |
1 files changed, 7 insertions, 3 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..393df763 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/utils/L.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/L.kt @@ -21,6 +21,8 @@ import ca.allanwang.kau.logging.KauLogger import ca.allanwang.kau.logging.KauLoggerExtension import com.bugsnag.android.Bugsnag import com.pitchedapps.frost.BuildConfig +import org.koin.core.KoinComponent +import org.koin.core.inject /** * Created by Allan Wang on 2017-05-28. @@ -31,9 +33,11 @@ object L : KauLogger("Frost", { when (it) { Log.VERBOSE -> BuildConfig.DEBUG Log.INFO, Log.ERROR -> true - else -> BuildConfig.DEBUG || Prefs.verboseLogging + else -> BuildConfig.DEBUG || L.prefs.verboseLogging } -}) { +}), KoinComponent { + + private val prefs: Prefs by inject() inline fun test(message: () -> Any?) { _d { @@ -67,7 +71,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 || !bugsnagInit || !prefs.analytics) { super.logImpl(priority, message, t) } else { if (message != null) { |