Replies: 2 comments 3 replies
-
In your example, there are no spans, so I'm not sure how to reproduce the precise issue you're having. However, I would wonder if the issue is that the spans in your code have the |
Beta Was this translation helpful? Give feedback.
-
Thanks, the code for the spans was actually elsewhere and not shown in the snippet. To get the desired behaviour, I needed to do this: let _ = SubscriberBuilder::default()
.with_line_number(true)
.with_file(true)
.with_span_events(FmtSpan::FULL)
.with_env_filter(EnvFilter::from_default_env())
.finish()
.try_init(); With this, log::info!/etc calls targetting However, there is still a problem. When specifying a function as below: #[cfg_attr(feature = "localhost-testing", tracing::instrument(target = "myapp", skip_all, ret, err))]
async fn dummy() -> Result<(), String> {
Err(String::from("An error targetting `myapp` with level=error should be emitted"))
} If the env var |
Beta Was this translation helpful? Give feedback.
-
Consider this code, which has the intention to use the environment variables to determine the min/max logging levels for a (possibly specific) crate, AND, ensure that spans get written:
When using
RUST_LOG=myapp=trace
, we would expect that all events and spans be printed. However, using this configuration, no spans get printed. When thewith_env_filter
is not used, then, spans are printed, however, we are no longer using the env variables.Beta Was this translation helpful? Give feedback.
All reactions