Skip to content

Instantly share code, notes, and snippets.

@joeytsai
Created October 27, 2017 06:08
Show Gist options
  • Select an option

  • Save joeytsai/fd82edb5674b7849f5727bb17ce178ec to your computer and use it in GitHub Desktop.

Select an option

Save joeytsai/fd82edb5674b7849f5727bb17ce178ec to your computer and use it in GitHub Desktop.
Timber.plant(LinkingDebugTree())
// 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