Skip to content

Instantly share code, notes, and snippets.

@alexshr
Last active Feb 9, 2019
Embed
What would you like to do?
init Timber output format (with class, method, thread names and line number)
private void initTimber(){
if (BuildConfig.DEBUG) {
Timber.plant(new DebugTree() {
@SuppressLint("DefaultLocale")
@Override
protected String createStackElementTag(@NonNull StackTraceElement element) {
return String.format("%s: %s:%d (%s)",
super.createStackElementTag(element),
element.getMethodName(),
element.getLineNumber(),
Thread.currentThread().getName());
}
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment