Last active
September 30, 2022 10:44
-
-
Save cp-hardik-p/8e2839b78e2344a1730cedc08f40b83b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class CrashlyticsLogTree(private val firebaseCrashlytics: FirebaseCrashlytics) : Timber.Tree() { | |
| override fun log(priority: Int, tag: String?, message: String, t: Throwable?) { | |
| if (t != null) { | |
| firebaseCrashlytics.recordException(CrashlyticsNonFatalError("$tag : $message", t)) | |
| } else { | |
| firebaseCrashlytics.log("$priority/$tag: $message") | |
| } | |
| } | |
| class CrashlyticsNonFatalError constructor(message: String, cause: Throwable) : | |
| RuntimeException(message, cause) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment