-
Notifications
You must be signed in to change notification settings - Fork 823
Open
Description
Feature Request
Add a way to enable logging the PID for each log line in tracing-subscriber
.
Crates
tracing-subscriber
Motivation
Sometimes you spawn many processes in the same terminal, and want to figure out which is logging what.
Proposal
There is already .with_thread_ids(true)
, so I suggest adding a .with_pid(true)
;
A more general solution would be .with_custom_string(std::process::id().to_string())
.
Alternatives
Users can already implement it with a custom formatter, but it is a lot of work and not a lot of docs.
I believe one has to write a FormatEvent
via SubscriberBuilder::event_format
. One can look at https://github.com/davidbarsky/tracing-glog/ and try to do something similar, but again - it is a lot of work.
zanieb, REASY and loshzRyanAD
Metadata
Metadata
Assignees
Labels
No labels