Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Timber tree for use with Firebase Crash Reporting. Basically a copy/rewrite of Jake Wharton's CrashlyticsTree.
private static class FirebaseTree extends Timber.Tree {
protected void log(int priority, String tag, String message, Throwable t) {
if (priority == Log.VERBOSE || priority == Log.DEBUG) {
if (t != null) {;

This comment has been minimized.

Copy link

@PaulWoitaschek PaulWoitaschek commented Dec 10, 2016

Have a look at the javadoc of timber

* @param message Formatted log message. May be {@code null}, but then {@code t} will not be.
* @param t Accompanying exceptions. May be {@code null}, but then {@code message} will not be.

So you should check for null when logging the message too.


This comment has been minimized.

Copy link

@siergiej-jdw siergiej-jdw commented May 13, 2020

The FirebaseCrash is deprecated. Please see the fix:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment