tracing icon indicating copy to clipboard operation
tracing copied to clipboard

subscriber: add with_binary_name and with_process_id options.

Open nicolasavru opened this issue 1 year ago • 7 comments

Motivation

These options are useful when multiple processes are logging to the same destination (stderr, in the common case). This can happen when a process launches a child process or when a user simply launches multiple processes in the same terminal.

Fixes #2447.

Solution

Implement these two options.

nicolasavru avatar Jul 16 '23 05:07 nicolasavru

I was going back and forth on whether to put the binary name and pid before or after the log level on the line. I think I'm leaning towards before (so right after the timestamp) currently, but what do you think?

nicolasavru avatar Jul 16 '23 05:07 nicolasavru

I'd love to see this merged. Can I help promote this somehow?

aviramha avatar Mar 28 '24 11:03 aviramha

I think it's a useful feature to have

WindSoilder avatar May 23 '24 09:05 WindSoilder

Is this planned to be merged anytime soon? I'd like to switch to tracing but we also merge logs of multiple applications and need to see the application name as part of the log.

gz avatar Jul 05 '24 06:07 gz

No strong opinion on the order, but if you are showing multiple application logs in one terminal IMHO it's nicer if the order is Timestamp Loglevel <anything else> because the loglevel and timestamp will always be the same length and aligned on every line, so it's easier on the eye to scan for error, warn etc.

gz avatar Jul 09 '24 15:07 gz

That's actually a good point @gz! Let's do it like that then.

kaffarell avatar Jul 09 '24 17:07 kaffarell

Addressed comments, went back to Timestamp Loglevel <anything else>, rebased. I assume I should backport this to the v0.1 branch in a followup PR?

nicolasavru avatar Jul 10 '24 16:07 nicolasavru