Closed CAD97 closed 1 year ago
My stack setup:
use tracing_filter::legacy::Filter;
color_eyre::install()?;
let (filter, diagnostics) = Filter::parse("info,crate=debug");
assert!(diagnostics.is_none());
let fmt = tracing_tree::HierarchicalLayer::default()
.with_ansi(supports_color::on(supports_color::Stream::Stderr).is_some())
.with_targets(true);
tracing_subscriber::registry()
.with(fmt.with_filter(filter))
.with(tracing_error::ErrorLayer::default())
.try_init()?;
I think this behavior is partly a bug inside of tracing-subscriber, but given this causes issues, then let's fix it here.
Thanks for the fix. To make this show up in search results, I'm just going to put the error text right here: Unable to get span scope; this is a bug
This can occur when there are active spans, but all of the active spans are filtered out by a per-layer filter, so don't show up to us.
I'm not sure if this is considered more a tracing bug or a tracing-tree bug, but this fixed the crash for me, so I'm submitting it here for discussion.