dylanbstorey / pyo3-pylogger

log messages for pyo3 embedded Python applications using the logging module
Apache License 2.0
3 stars 2 forks source link

Support tracing logger? #5

Open WindSoilder opened 8 months ago

WindSoilder commented 8 months ago

Hi, while reading example, I found that it uses log crate to initialize and log something.

I'm using tracing in application, and it seems that the log messages in python code doesn't show.

I don't want to introduce another log crate to my application, is there a way to make it work with tracing?

dylanbstorey commented 8 months ago

Hi, while reading example, I found that it uses log crate to initialize and log something.

I'm using tracing in application, and it seems that the log messages in python code doesn't show.

I don't want to introduce another log crate to my application, is there a way to make it work with tracing?

Yes that should be doable, im a bit busy atm but PRs are welcome.

cpu commented 2 months ago

FWIW I've been using this crate in an application that uses tracing through tracing-log. Thank you! It's a very helpful crate :crab: :heart: :snake:

Log messages from Python do appear in the expected place, with the correct level/message/source line number. The only foible in this setup I've observed is that the source file name is incorrect. PTAL at this branch for a fix that worked for me: https://github.com/dylanbstorey/pyo3-pylogger/pull/7

I'm not sure it's worth complicating this crate with tracing specific logic given the tracing-log crate exists and seems to work well out-of-box.

dylanbstorey commented 2 months ago

<3 to hear that !!!!