Back to project page timber.
The source code is released under:
Apache License
If you think the Android project timber listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.example.timber; //from w w w .ja v a 2 s. c o m import android.app.Application; import timber.log.Timber; import static timber.log.Timber.DebugTree; public class ExampleApp extends Application { @Override public void onCreate() { super.onCreate(); if (BuildConfig.DEBUG) { Timber.plant(new DebugTree()); } else { Timber.plant(new CrashReportingTree()); } } /** A tree which logs important information for crash reporting. */ private static class CrashReportingTree extends Timber.HollowTree { @Override public void i(String message, Object... args) { // TODO e.g., Crashlytics.log(String.format(message, args)); } @Override public void i(Throwable t, String message, Object... args) { i(message, args); // Just add to the log. } @Override public void e(String message, Object... args) { i("ERROR: " + message, args); // Just add to the log. } @Override public void e(Throwable t, String message, Object... args) { e(message, args); // TODO e.g., Crashlytics.logException(t); } } }