Skip to content

Commit 31cf77e

Browse files
committed
fix
1 parent d82d052 commit 31cf77e

File tree

4 files changed

+19
-6
lines changed

4 files changed

+19
-6
lines changed

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

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ open class DebugFormatTree(private val newLogcat: Boolean = true) : Timber.Debug
3838
}
3939

4040
// if there is an JSON string, try to print out pretty
41-
override fun logMessage(priority: Int, tag: String?, message: String, t: Throwable?, vararg args: Any?) {
41+
override fun log(priority: Int, tag: String?, message: String, t: Throwable?) {
4242
var localMessage = message.trim()
4343
if (localMessage.startsWith("{") && localMessage.endsWith("}")) {
4444
try {
@@ -47,6 +47,19 @@ open class DebugFormatTree(private val newLogcat: Boolean = true) : Timber.Debug
4747
} catch (_: JSONException) {
4848
}
4949
}
50-
super.logMessage(priority, tag, "$method: $localMessage", t, args)
50+
super.log(priority, tag, "$method: $localMessage", t)
5151
}
52+
53+
// if there is an JSON string, try to print out pretty
54+
// override fun logMessage(priority: Int, tag: String?, message: String, t: Throwable?, vararg args: Any?) {
55+
// var localMessage = message.trim()
56+
// if (localMessage.startsWith("{") && localMessage.endsWith("}")) {
57+
// try {
58+
// val json = JSONObject(message)
59+
// localMessage = json.toString(3)
60+
// } catch (_: JSONException) {
61+
// }
62+
// }
63+
// super.logMessage(priority, tag, "$method: $localMessage", t, args)
64+
// }
5265
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ open class FileLoggingTree(externalCacheDir: File, context: Context? = null, fil
4545
}
4646

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

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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ 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
}
1515

16-
super.log(priority, tag, message, t, args)
16+
super.log(priority, tag, message, t)
1717

1818
FirebaseCrashlytics.getInstance().setCustomKey(
1919
"PRIORITY", when (priority) {

0 commit comments

Comments
 (0)