aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/utils
diff options
context:
space:
mode:
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()
}
}