support sending the underlying vararg to branch trees
See original GitHub issueThis is a potential feature request
With a lot of third party (logging/monitoring/crash) services, there are times when it’s useful to send metadata at a per log level (as against the global user level).
so basically instead of:
protected abstract fun log(priority: Int, tag: String?, message: String, t: Throwable?)
supply the args sent in as well
protected abstract fun log(priority: Int, tag: String?, message: String, t: Throwable?, vararg args: Any?)
This allows branch trees to potentially send the args separately to a service (potentially attaching it as more metadata).
Can add more context, if the use case doesn’t make sense. I think it’s similar to what was brought up here (I think).
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Adding optional meta data to Timber logs · Issue #184 - GitHub
Timber can support generics when logging in order to define a specific log ... support sending the underlying vararg to branch trees #392....
Read more >Variable Arguments (Varargs) in Java - GeeksforGeeks
From JDK 5 onwards, we can declare a method with a variable number of arguments. Such types of methods are called Varargs methods....
Read more >Kotlin's vararg and spread operator | by Tibi Csabai
In conclusion, when combining spread values into a vararg parameter, a SpreadBuilder is used behind the scenes to gather all the values. The ......
Read more >[SLF4J-23] Varargs for Logger methods - QOS.ch JIRA
We've studied this case closely, and it requires an important change. By providing this functionality, we'll have to maintain two active branches of...
Read more >Tree-support parameters — Basic | Netfabb
The tree-support parameters control the size and shape of the trees ... the angle from horizontal at which the tree branches are created....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m getting back into Timber soon™. I know it’s been kinda stuck for a while.
Can you add your usecase to #184 in as much detail as you’re able to share?
Kotlin inline functions and deferred lambdas and string templating is coming, but that’s going to be totally separate from “context” arguments. Vararg is kinda terrible because you’re allocating the array and filling its contents even when logging is disabled. And even when it’s enabled, you immediately unpack the array. Bad all around. I don’t want to re-use it for contexts/metadata.