Closed cpu closed 2 months ago
(Note: this will fail in CI until https://github.com/dylanbstorey/pyo3-pylogger/pull/6 is merged - the project's relaxed version requirement for pyo3 means it's pulling in 0.22 but not activating the gil-refs
feature to allow using deprecated APIs).
Very nice - thanks for the thoughful explanation and PR !
released with 0.3.0
released with 0.3.0
@dylanbstorey it looks like 0.2.2 is the latest release available on crates.io. Can I trouble you to publish 0.3.0 there?
I think the Cargo.toml
version needs a bump first too: https://github.com/dylanbstorey/pyo3-pylogger/blob/e69fee5949f220178623fa542cf758cd33c7b8ab/Cargo.toml#L3
Sorry, just coming back around now trying to pick this change up in my dependent project.
Merged and released correctly this time. Soz!
Previously the
RecordBuilder
used inhost_log()
to construct aLog
item hardcoded the record'sfile()
asSome("app.rs")
. https://github.com/dylanbstorey/pyo3-pylogger/blob/d89e0d6820ebc4f067647e3b74af59dbc4941dd5/src/lib.rs#L72This branch updates the logic to use
&pathname
("Full pathname of the source file where the logging call was issued (if available).") instead.This value is already being provided to
module_path()
, but arguably that usage should be changed torecord.getattr("module")
(described in the python docs as "Module (name portion of filename).") instead ofrecord.getattr("pathname")
. I've left that as-is for now pending discussion since it doesn't affect the default formatting oftracing
events, and that's where my focus is today.Before this change when using
tracing-log
to adapt theLog
record to thetracing
ecosystem w/ default formatting an event like the following was produced:Afterwards, it produces an event like:
Along the way I tidied up the builder construction a little bit :-)
Relates to https://github.com/dylanbstorey/pyo3-pylogger/issues/5