Last active
October 29, 2022 23:30
-
-
Save hanspeide/5387d59e316dea9f34060703cea180cb to your computer and use it in GitHub Desktop.
Timber tree for use with Firebase Crash Reporting. Basically a copy/rewrite of Jake Wharton's CrashlyticsTree.
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
private static class FirebaseTree extends Timber.Tree { | |
@Override | |
protected void log(int priority, String tag, String message, Throwable t) { | |
if (priority == Log.VERBOSE || priority == Log.DEBUG) { | |
return; | |
} | |
FirebaseCrash.log(message); | |
if (t != null) { | |
FirebaseCrash.report(t); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Have a look at the javadoc of timber
So you should check for null when logging the message too.