emabee / flexi_logger

A flexible logger for rust programs that can write to stderr, stdout, and/or to log files
Apache License 2.0
307 stars 50 forks source link

[trc] Improve usability by getting values from `Logger` or integrating with it #154

Open hasezoey opened 8 months ago

hasezoey commented 8 months ago

I came across tracing and noticed that flexi_logger has some support for it, so i tried it out, and once it is working it is working "great", but the setup is a little more annoying that should likely be, here some points:

TL;DR: clone a Logger's configuration (like printing to various places like stdout/stderr and files) or integrating with it

Please note that i dont have too much experience with tracing itself, as i just came around to find it (and async in general).

Maybe i am also completely misunderstanding on how tracing in flexi_logger or tracing in general is meant to be used

example of current non-tracing Logger / LoggerHandle creation we use

emabee commented 6 months ago

Thanks a lot for the feedback! I fully agree. At least when I wrote the stuff, the API of tracing for subscribers was really hard to use, much more than it should be. I'll give it another try...