A bit confused about tracing-log v0.2.0
#2779
Answered
by
hawkw
frederikhors
asked this question in
Q&A
-
I'm a bit confused about tracing-log I was using tracing = { version = "0.1.40", default-features = false, features = ["log"] }
tracing-appender = { version = "0.2.2", default-features = false }
tracing-log = { version = "0.1.3", default-features = false }
tracing-subscriber = { version = "0.3.17", default-features = false } like this: use tracing_log::LogTracer;
//...
LogTracer::init().expect("tracer init");
//... What should I do now with |
Beta Was this translation helpful? Give feedback.
Answered by
hawkw
Oct 30, 2023
Replies: 1 comment 4 replies
-
You can remove |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I don't think @davidbarsky's answer is correct. The API that was removed in
tracing-log
v0.2.0 wasTraceLogger
(which had been deprecated for a while), notLogTracer
, which should still be present: https://docs.rs/tracing-log/latest/tracing_log/struct.LogTracer.html.The issue here is that
LogTracer
API is feature flagged. Since you're depending ontracing-log
withdefault-features = false
, you need to addfeatures = ["log-tracer"]
for the API to be present. The reason that it worked withtracing-log
v0.1.x is that some other crate in your dependency tree also depends ontracing-log
v0.1 with that feature flag enabled, so it was enabled for you by that dependency.