-
Notifications
You must be signed in to change notification settings - Fork 756
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Instrument attribute spans do not appear using log feature #2585
Comments
Huh, that seems quite weird. I would also expect the |
I believe the problem is this line. As I understand it, |
## Motivation The instrument macro currently doesn't work with the "log" crate feature: #2585 ## Solution Change the generated code to create a span if either `tracing::if_log_enabled!` or `tracing::level_enabled!`. I'm not sure how to add a test for this or if this is the best solution. Fixes #2585
## Motivation The instrument macro currently doesn't work with the "log" crate feature: #2585 ## Solution Change the generated code to create a span if either `tracing::if_log_enabled!` or `tracing::level_enabled!`. I'm not sure how to add a test for this or if this is the best solution. Fixes #2585
## Motivation The instrument macro currently doesn't work with the "log" crate feature: #2585 ## Solution Change the generated code to create a span if either `tracing::if_log_enabled!` or `tracing::level_enabled!`. I'm not sure how to add a test for this or if this is the best solution. Fixes #2585
## Motivation The instrument macro currently doesn't work with the "log" crate feature: #2585 ## Solution Change the generated code to create a span if either `tracing::if_log_enabled!` or `tracing::level_enabled!`. I'm not sure how to add a test for this or if this is the best solution. Fixes #2585
## Motivation The instrument macro currently doesn't work with the "log" crate feature: #2585 ## Solution Change the generated code to create a span if either `tracing::if_log_enabled!` or `tracing::level_enabled!`. I'm not sure how to add a test for this or if this is the best solution. Fixes #2585
## Motivation The instrument macro currently doesn't work with the "log" crate feature: #2585 ## Solution Change the generated code to create a span if either `tracing::if_log_enabled!` or `tracing::level_enabled!`. I'm not sure how to add a test for this or if this is the best solution. Fixes #2585
## Motivation The instrument macro currently doesn't work with the "log" crate feature: #2585 ## Solution Change the generated code to create a span if either `tracing::if_log_enabled!` or `tracing::level_enabled!`. I'm not sure how to add a test for this or if this is the best solution. Fixes #2585
Bug Report
Version
0.1.37
Platform
Description
I would like to use
tracing
and its#[instrument]
attribute while also usingenv_logger
. We might eventually use a proper subscriber approach, but we've done some work to getenv_logger
working the way we want it in our system and this is a good way to incrementally migrate over totracing
.The documentation says:
With this code:
I get this output (running with no Rust or Tracing related env vars set):
Here's a demo in the Rust Explorer.
I am confused by seeing the
main
span but not thecheck
span. I would expect both to be present or absent depending on the log level.I also noted this in the docs:
Hence the extra
filter_module()
filters in there. I don't think they affect it though. It is also not a level problem, as the othertrace
messages appear.The example works as expected using a
fmt()
subscriber.The text was updated successfully, but these errors were encountered: