From 55405742a8b397faba23b8207cb38497a215b484 Mon Sep 17 00:00:00 2001 From: Mygod Date: Wed, 3 Oct 2018 13:28:44 +0800 Subject: [PATCH] Fix logging --- mobile/build.gradle | 4 ++-- mobile/src/base/java/be/mygod/vpnhotspot/Timber.kt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mobile/build.gradle b/mobile/build.gradle index cb947ba8..c6fc1d29 100644 --- a/mobile/build.gradle +++ b/mobile/build.gradle @@ -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' diff --git a/mobile/src/base/java/be/mygod/vpnhotspot/Timber.kt b/mobile/src/base/java/be/mygod/vpnhotspot/Timber.kt index 1a7d1b9b..1909ac79 100644 --- a/mobile/src/base/java/be/mygod/vpnhotspot/Timber.kt +++ b/mobile/src/base/java/be/mygod/vpnhotspot/Timber.kt @@ -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") }