Skip to content

Commit 4894135

Browse files
committed
Revert "Timber with delegation"
This reverts commit 9314ca9.
1 parent 9959762 commit 4894135

6 files changed

Lines changed: 10 additions & 10 deletions

File tree

LogcatCoreLib/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ dependencies {
2323
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4"
2424
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.5.0"
2525
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.5.0'
26-
api 'com.github.hannesa2:timber:5.0.1.2'
26+
api 'com.jakewharton.timber:timber:5.0.1'
2727
}
2828

2929
project.afterEvaluate {

LogcatCoreLib/src/main/java/info/hannes/logcat/LoggingApplication.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import android.app.Application
44
import info.hannes.timber.DebugFormatTree
55
import timber.log.Timber
66

7-
open class LoggingApplication(private val delegator: Class<*>? = null) : Application() {
7+
open class LoggingApplication : Application() {
88

99
override fun onCreate() {
1010
super.onCreate()
@@ -14,6 +14,6 @@ open class LoggingApplication(private val delegator: Class<*>? = null) : Applica
1414
@Suppress("MemberVisibilityCanBePrivate")
1515
protected open fun setupLogging() {
1616
LoggingTools.globalErrorCatcher()
17-
Timber.plant(DebugFormatTree(delegator = delegator))
17+
Timber.plant(DebugFormatTree())
1818
}
1919
}

LogcatCoreLib/src/main/java/info/hannes/timber/DebugFormatTree.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import org.json.JSONException
44
import org.json.JSONObject
55
import timber.log.Timber
66

7-
open class DebugFormatTree(delegator: Class<*>? = null) : Timber.DebugTree(delegator = delegator) {
7+
open class DebugFormatTree : Timber.DebugTree() {
88

99
override fun createStackElementTag(element: StackTraceElement): String? {
1010
return String.format(
@@ -18,7 +18,7 @@ open class DebugFormatTree(delegator: Class<*>? = null) : Timber.DebugTree(deleg
1818
}
1919

2020
// if there is an JSON string, try to print out pretty
21-
override fun logMessage(priority: Int, tag: String?, message: String, t: Throwable?, vararg args: Any?) {
21+
override fun log(priority: Int, tag: String?, message: String, t: Throwable?) {
2222
var localMessage = message.trim()
2323
if (localMessage.startsWith("{") && localMessage.endsWith("}")) {
2424
try {
@@ -27,6 +27,6 @@ open class DebugFormatTree(delegator: Class<*>? = null) : Timber.DebugTree(deleg
2727
} catch (e: JSONException) {
2828
}
2929
}
30-
super.logMessage(priority, tag, localMessage, t, *args)
30+
super.log(priority, tag, localMessage, t)
3131
}
3232
}

LogcatCoreLib/src/main/java/info/hannes/timber/FileLoggingTree.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ open class FileLoggingTree(externalCacheDir: File, context: Context? = null, fil
4141
}
4242

4343
@SuppressLint("LogNotTimber")
44-
override fun logMessage(priority: Int, tag: String?, message: String, t: Throwable?, vararg args: Any?) {
44+
override fun log(priority: Int, tag: String?, message: String, t: Throwable?) {
4545
try {
4646
val logTimeStamp = SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS", Locale.getDefault()).format(Date())
4747

@@ -75,7 +75,7 @@ open class FileLoggingTree(externalCacheDir: File, context: Context? = null, fil
7575
}
7676
}
7777
// Don't call super, otherwise it logs twice
78-
//super.logMessage(priority, tag, message, t, args)
78+
//super.log(priority, tag, message, t)
7979
}
8080

8181
fun getFileName(): String = file.absolutePath

LogcatCountlyLib/src/main/java/info/hannes/timber/CountlyTree.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class CountlyTree(private val analytics: Analytics, private val serverIgnoreToke
1919
private val t = serverIgnoreToken
2020
private val regex: Regex = "$t.+?$t|$t[^$t]*$".toRegex()
2121

22-
override fun logMessage(priority: Int, tag: String?, message: String, t: Throwable?, vararg args: Any?) {
22+
override fun log(priority: Int, tag: String?, message: String, t: Throwable?) {
2323
// we ignore INFO, DEBUG and VERBOSE
2424
if (priority <= Log.INFO) {
2525
return

LogcatCrashlyticLib/src/main/java/info/hannes/crashlytic/CrashlyticsTree.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import java.util.concurrent.atomic.AtomicBoolean
88
@Suppress("unused")
99
class CrashlyticsTree(private val identifier: String? = null) : Timber.Tree() {
1010

11-
override fun logMessage(priority: Int, tag: String?, message: String, t: Throwable?, vararg args: Any?) {
11+
override fun log(priority: Int, tag: String?, message: String, t: Throwable?) {
1212
if (priority < Log.INFO) {
1313
return
1414
}

0 commit comments

Comments
 (0)