Fix logging

This commit is contained in:
Mygod
2018-10-03 13:28:44 +08:00
parent 8e09e8cd8a
commit 55405742a8
2 changed files with 4 additions and 4 deletions

View File

@@ -8,7 +8,7 @@ import timber.log.Timber
fun initTimber() {
Fabric.with(app, Crashlytics())
Timber.plant(object : Timber.Tree() {
Timber.plant(object : Timber.DebugTree() {
override fun log(priority: Int, tag: String?, message: String, t: Throwable?) {
if (t == null) Crashlytics.log(priority, tag, message) else {
// Crashlytics.logException doesn't print to logcat
@@ -20,6 +20,6 @@ fun initTimber() {
}
fun debugLog(tag: String?, message: String?) {
if (BuildConfig.DEBUG) Timber.d(tag, message)
if (BuildConfig.DEBUG) Timber.tag(tag).d(message)
Crashlytics.log("$tag: $message")
}