aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/utils/L.kt
diff options
context:
space:
mode:
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.kt21
1 files changed, 14 insertions, 7 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 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)
+ }
}
}
}