-
Notifications
You must be signed in to change notification settings - Fork 954
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
Optional call stack depth parameter #180
Comments
It's not entirely clear what you're asking for here. What might this "call stack adjustment value" look like? If I'm understanding your use case correctly, you'd like to be able ignore/override the default tags created by the |
I want this parameter to be adjustable: https://github.com/JakeWharton/timber/blob/master/timber/src/main/java/timber/log/Timber.java#L580 I want tags, I want calling function name, but I want to write functions that I call in my code. So the real interesting line and class in my code is the CALLER of my own function, this means, the I've solved that anyways already by handling a correction value the same way as a custom tag value... |
Any chances the linked pull request will be merged? Seems to be open for 2 years now. |
This is very needed. I use top level functions that wraps the Timber methods. |
This issue is a few years old - if someone needs this feature and maybe even more, feel free to use my library or to copy the base tree inside it: https://github.com/MFlisar/Lumberjack/blob/master/library/src/main/java/timber/log/BaseTree.kt |
Actually I've added an ability to the DebugTree to support this feature. I'll open a pull request |
Currently Timber does not allow overriding the fqcnIgnore list from DebugTree (see JakeWharton/timber#180). The source code has been copied locally and modified to allow overriding the list and renamed the log methods to avoid clash with the new extension functions.
The logging interface looks like following:
Why not add an additional call stack adjustment value?
Use cases
Maybe someone wants to write reuseable logging functions, that should log their calling functions parameters. Seems like a common use case for me.
Example - simple transformer for logging observables execution time
Here the log would print the line and class of my logger utility class, which is not perfect...
Wouldn't it make sense to extend the log interface for such use cases?
The text was updated successfully, but these errors were encountered: