Last active
February 9, 2019 00:56
-
-
Save alexshr/b8fa05d963927a445746ef64b61723b6 to your computer and use it in GitHub Desktop.
init Timber output format (with class, method, thread names and line number)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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