Added the HyperlinkedDebugTree class that creates Logs that include hyperlinks to the calling line#377
Open
Merthan wants to merge 2 commits intoJakeWharton:trunkfrom
Open
Conversation
…yperlinks to the calling line and class. This way you can just click on the Tag and directly jump to the source. Very useful in big projects.
|
@Merthan, in new versions of Android Studio, your idea should be implemented a bit differently: |
|
Alternatively, to not rely on |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added the HyperlinkedDebugTree class that creates Logs that include hyperlinks to the calling line
This way you can just click on the Tag and directly jump to the source. Very useful in big projects.
I think this should be included in some form as otherwise people who use the library won't know that this is even a possibility. I certainly didn't :D
The class also has a boolean variable that controls whether or not to show the method name too.
So planting it either looks like this:
Timber.plant(HyperlinkedDebugTree(false))Or (because it's default value is true):
Timber.plant(HyperlinkedDebugTree())This then looks similar to this (with clickable Hyperlinks)
D/(AddItemFragment.kt:222)getImageCaptureUri(): logMessageD/(AddItemFragment.kt:222): logMessage(there is no space before the ":", only here because I had to mark it as a link)
If you want to merge this PR but I forgot something like Testing or perhaps stuff like adding it in the Changelog, tell me.
At some point this might even be useful in the Readme file🗡