Skip to content

Instantly share code, notes, and snippets.

@alexshr
Last active February 9, 2019 00:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexshr/b8fa05d963927a445746ef64b61723b6 to your computer and use it in GitHub Desktop.
Save alexshr/b8fa05d963927a445746ef64b61723b6 to your computer and use it in GitHub Desktop.
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