aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/utils
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2019-07-27 22:02:33 -0700
committerAllan Wang <me@allanwang.ca>2019-07-27 22:02:33 -0700
commit65ad23e07634f2a1605dcc7768488d933a0aa6fb (patch)
tree0215371309f8bd97f86ce74512b4d41d74cfb7e2 /app/src/main/kotlin/com/pitchedapps/frost/utils
parent25ad3000743b108f7018bae8fb65b4988d953c3c (diff)
downloadfrost-65ad23e07634f2a1605dcc7768488d933a0aa6fb.tar.gz
frost-65ad23e07634f2a1605dcc7768488d933a0aa6fb.tar.bz2
frost-65ad23e07634f2a1605dcc7768488d933a0aa6fb.zip
Toggle auto capture sessions
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/utils')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/utils/L.kt5
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt2
2 files changed, 7 insertions, 0 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 e5dd30e3..dd8cf594 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/utils/L.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/L.kt
@@ -61,6 +61,11 @@ object L : KauLogger("Frost", {
var bugsnagInit = false
override fun logImpl(priority: Int, message: String?, t: Throwable?) {
+ /*
+ * Debug flag is constant and should help with optimization
+ * 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) {
super.logImpl(priority, message, t)
} else {
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt b/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt
index c11583d1..0885109a 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt
@@ -160,8 +160,10 @@ object Prefs : KPref() {
var analytics: Boolean by kpref("analytics", false) {
if (!BuildConfig.DEBUG) {
if (it) {
+ Bugsnag.setAutoCaptureSessions(true)
Bugsnag.enableExceptionHandler()
} else {
+ Bugsnag.setAutoCaptureSessions(false)
Bugsnag.disableExceptionHandler()
}
}