From 1796aa0ee637c3fd65eb58392a287ea0abdd6e70 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sat, 27 Jul 2019 21:50:56 -0700 Subject: Disable auto session capture until analytics is disabled --- .../main/kotlin/com/pitchedapps/frost/utils/L.kt | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'app/src/main/kotlin/com/pitchedapps/frost/utils') 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 7c8c1895..6da4f598 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/utils/L.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/L.kt @@ -41,28 +41,35 @@ object L : KauLogger("Frost", { } inline fun _i(message: () -> Any?) { - if (BuildConfig.DEBUG) + if (BuildConfig.DEBUG) { i(message) + } } inline fun _d(message: () -> Any?) { - if (BuildConfig.DEBUG) + if (BuildConfig.DEBUG) { d(message) + } } inline fun _e(e: Throwable?, message: () -> Any?) { - if (BuildConfig.DEBUG) + if (BuildConfig.DEBUG) { e(e, message) + } } + var bugsnagInit = false + override fun logImpl(priority: Int, message: String?, t: Throwable?) { - if (BuildConfig.DEBUG) + if (BuildConfig.DEBUG || !bugsnagInit || Prefs.analytics) { super.logImpl(priority, message, t) - else { - if (message != null) + } else { + if (message != null) { Bugsnag.leaveBreadcrumb(message) - if (t != null) + } + if (t != null) { Bugsnag.notify(t) + } } } } -- cgit v1.2.3