question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

support sending the underlying vararg to branch trees

See original GitHub issue

This 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:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
JakeWhartoncommented, May 23, 2020

I’m getting back into Timber soon™. I know it’s been kinda stuck for a while.

1reaction
JakeWhartoncommented, May 23, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found