diff options
author | Allan Wang <me@allanwang.ca> | 2017-08-07 23:04:40 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-07 23:04:40 -0700 |
commit | 397cc1f54725aee6fb542b08f965389272469309 (patch) | |
tree | d5b7ea8185c0ae9596cdcd0c48cca2586f86a5f7 /app/src/main/kotlin/com/pitchedapps/frost/utils/L.kt | |
parent | ab7ec131b62ac1567e983c846c921bd3ada11dd4 (diff) | |
download | frost-397cc1f54725aee6fb542b08f965389272469309.tar.gz frost-397cc1f54725aee6fb542b08f965389272469309.tar.bz2 frost-397cc1f54725aee6fb542b08f965389272469309.zip |
Update/kau (#125)
* Update logger
* Clean imports and bring back reactive libs
* Update dependencies and make billing async
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 | 31 |
1 files changed, 10 insertions, 21 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 16a3d2ae..d5c1a6fb 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/utils/L.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/L.kt @@ -1,9 +1,8 @@ package com.pitchedapps.frost.utils -import android.util.Log -import ca.allanwang.kau.logging.TimberLogger +import ca.allanwang.kau.logging.KauLogger import com.crashlytics.android.Crashlytics -import timber.log.Timber +import com.pitchedapps.frost.BuildConfig /** @@ -16,25 +15,15 @@ import timber.log.Timber * Debug and Error logs must not reveal person info * Person info logs can be marked as info or verbose */ -object L : TimberLogger("Frost") { +object L : KauLogger("Frost") { - /** - * Helper function to separate private info - */ - fun d(tag: String, personal: String?) { - L.d(tag) - L.i("-\t$personal") - } -} - -internal class CrashReportingTree : Timber.Tree() { - override fun log(priority: Int, tag: String?, message: String?, t: Throwable?) { - when (priority) { - Log.VERBOSE, Log.INFO -> return - Log.DEBUG -> if (!Prefs.verboseLogging) return + override fun logImpl(priority: Int, message: String?, privateMessage: String?, t: Throwable?) { + if (BuildConfig.DEBUG) { + super.logImpl(priority, message, privateMessage, t) + } else { + if (message != null) + Crashlytics.log(priority, "Frost", message) + if (t != null) Crashlytics.logException(t) } - if (message != null) - Crashlytics.log(priority, "Frost", message) - if (t != null) Crashlytics.logException(t) } }
\ No newline at end of file |