-
Notifications
You must be signed in to change notification settings - Fork 971
Allow additional ignored classes when inferring tags in DebugTree #362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
Allow additional ignored classes when inferring tags in DebugTree #362
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
fqcnIgnore
from a list into a set because only itscontains
method is used.