package net.squanchy.analytics;

import com.crashlytics.android.Crashlytics;

import timber.log.Timber;

public class CrashlyticsErrorsTree extends Timber.Tree {

    @Override
    protected boolean isLoggable(String tag, int priority) {
        return true;
    }

    @Override
    protected void log(int priority, String tag, String message, Throwable t) {
        if (t != null) {
            Crashlytics.logException(t);
        }
    }
}

@@ -67,24 +67,58 @@
 ashlytics;%0A%0A
+import net.squanchy.BuildConfig;%0A%0A
 import timbe
@@ -190,16 +190,80 @@
 Tree %7B%0A%0A
+    private static final boolean CAN_LOG = !BuildConfig.DEBUG;%0A%0A
     @Ove
@@ -472,16 +472,27 @@
  != null
+ && CAN_LOG
 ) %7B%0A    

Disable Crashlytics for debug builds