Skip to content

Commit

Permalink
fix: if Timber.d() args is empty array, throw UnknownFormatConversi…
Browse files Browse the repository at this point in the history
…onException
  • Loading branch information
muedsa committed Mar 26, 2024
1 parent 348a530 commit 847902a
Showing 1 changed file with 35 additions and 36 deletions.
71 changes: 35 additions & 36 deletions app/src/main/kotlin/com/muedsa/uitl/LogUtil.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,40 @@ package com.muedsa.uitl
import com.google.firebase.crashlytics.FirebaseCrashlytics
import timber.log.Timber

class LogUtil {
companion object {
@JvmStatic
fun d(message: String?, vararg args: Any?) {
Timber.d(message, args)
}

@JvmStatic
fun d(t: Throwable?) {
Timber.d(t)
}

@JvmStatic
fun d(t: Throwable?, message: String?, vararg args: Any?) {
Timber.d(t, message, args)
}

@JvmStatic
fun fb(message: String) {
Timber.d(message)
FirebaseCrashlytics.getInstance().log(message)
}

@JvmStatic
fun fb(t: Throwable) {
Timber.d(t)
FirebaseCrashlytics.getInstance().recordException(t)
}

@JvmStatic
fun fb(t: Throwable, message: String) {
Timber.d(t, message)
val crashlytics = FirebaseCrashlytics.getInstance()
crashlytics.log(message)
crashlytics.recordException(t)
}
object LogUtil {

@JvmStatic
fun d(message: String) {
Timber.d(message)
}

@JvmStatic
fun d(t: Throwable) {
Timber.d(t)
}

@JvmStatic
fun d(t: Throwable, message: String) {
Timber.d(t, message)
}

@JvmStatic
fun fb(message: String) {
Timber.d(message)
FirebaseCrashlytics.getInstance().log(message)
}

@JvmStatic
fun fb(t: Throwable) {
Timber.d(t)
FirebaseCrashlytics.getInstance().recordException(t)
}

@JvmStatic
fun fb(t: Throwable, message: String) {
Timber.d(t, message)
val crashlytics = FirebaseCrashlytics.getInstance()
crashlytics.log(message)
crashlytics.recordException(t)
}
}

0 comments on commit 847902a

Please sign in to comment.