Created
October 27, 2017 06:08
-
-
Save joeytsai/fd82edb5674b7849f5727bb17ce178ec to your computer and use it in GitHub Desktop.
Timber.plant(LinkingDebugTree())
This file contains hidden or 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
| // Make Logcat clickable | |
| private class LinkingDebugTree : Timber.DebugTree() { | |
| override fun createStackElementTag(e: StackTraceElement): String { | |
| val tag = "(${e.fileName}:${e.lineNumber})" | |
| return if (tag.length <= MAX_TAG_LENGTH) tag else super.createStackElementTag(e) | |
| } | |
| companion object { | |
| private val MAX_TAG_LENGTH = 23 | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment