Allow additional ignored classes when inferring tags in DebugTree#362
Allow additional ignored classes when inferring tags in DebugTree#362drewhamilton wants to merge 2 commits intoJakeWharton:trunkfrom
Conversation
|
Do we need to add the additional exception list post instantiation? Might be better to just offer a constructor param to allow consumer send class list, that way the list can be immutable still. From a consumer perspective, typically you initialize Timber once and don't touch it again. |
|
|
Yeah, that's a better API. Happy to update if there's interest in merging this feature. |
|
I am very interested by this :) |
|
Yeah me too. 👍 |
0b0cb4e to
a3decdc
Compare
|
Converted to a constructor parameter. The semantics are a bit weird now though: it's not obvious when reading |
I think that is a valid consideration, we can add a static factory to make the API more explicit. |
|
What if we wrap Timber logs inside kotlin top level functions? LogExtension.kt: fun logD("message") {
Timber.d(message)
}Then if we want to ignore it we do not access to the class. However there is an auto generated class named |
|
Any update on this? |
|
Any update? |
|
alternative plan |
|
I encountered the same issue. I wanted to wrap Timber in a separate logging module and inject it with Hilt wherever necessary. Since the PR has been open for almost six years now, I ended up writing a small logging class myself. However, I’d love to see this get merged so I can replace my implementation. |
Fixes #180 on a per-Tree basis.
Replaces #314 given the new internal tag-determination logic.
Add
DebugTree#ignoreForTagging(Class)to allow more classes to be ignored when the tag is inferred from the stacktrace. This is useful for anyone needing to wrap Timber, e.g. for use in a Java-only module.Also changes
fqcnIgnorefrom a list into a set because only itscontainsmethod is used.