Fix logging
This commit is contained in:
@@ -2,7 +2,7 @@ apply plugin: 'com.android.application'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply plugin: 'kotlin-kapt'
|
||||
|
||||
if (getGradle().getStartParameter().getTaskRequests().toString().contains("base"))
|
||||
if (getGradle().getStartParameter().getTaskRequests().toString().contains("Base"))
|
||||
apply plugin: 'io.fabric'
|
||||
|
||||
android {
|
||||
@@ -76,5 +76,5 @@ dependencies {
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4'
|
||||
}
|
||||
|
||||
if (getGradle().getStartParameter().getTaskRequests().toString().contains("base"))
|
||||
if (getGradle().getStartParameter().getTaskRequests().toString().contains("Base"))
|
||||
apply plugin: 'com.google.gms.google-services'
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user