Skip to content

Instantly share code, notes, and snippets.

@omainegra
Forked from hanspeide/TimberFirebase.java
Created July 16, 2017 21:17
Show Gist options
  • Save omainegra/85a2c83eac8e39888c9f817710a9a3cd to your computer and use it in GitHub Desktop.
Save omainegra/85a2c83eac8e39888c9f817710a9a3cd 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.
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