Skip to content

Instantly share code, notes, and snippets.

@AlbertVilaCalvo
Last active December 19, 2016 10:29
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 AlbertVilaCalvo/734ee62c54330ecd8b428a578d5b22b1 to your computer and use it in GitHub Desktop.
Save AlbertVilaCalvo/734ee62c54330ecd8b428a578d5b22b1 to your computer and use it in GitHub Desktop.
Timber tree for logging line numbers in Android
// Put this in Application onCreate()
Timber.plant(new Timber.DebugTree() {
@Override
protected String createStackElementTag(StackTraceElement element) {
// Add the line number
return super.createStackElementTag(element) + ":" + element.getLineNumber();
}
});
Timber.plant(new StethoTree());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment