In my application, I'm emitting info_span! as a visual aid for tracking progress, and debug_span! as a debugging aid for when a tracing::error! occurs.
For info_span!, it is useful for me to set .with_deferred_spans(false), since I always want those shown. But for debug_span!, I really want to set .with_deferred_spans(false), since the debugging spans are only relevant when debugging.
Would it be possible for me to never defer emitting the info_span!s, but always defer emitting the debug_span!s? Something like HierarchicalLayer::with_deferred_spans(level: LevelFilter).
It's probable that I haven't grokked the tracing docs properly, and that there's already a clean way to do this by inserting two layers and using filters? Or maybe I'm holding it wrong, and I shouldn't use tracing spans in this manner in the first place?
In my application, I'm emitting
info_span!as a visual aid for tracking progress, anddebug_span!as a debugging aid for when atracing::error!occurs.For
info_span!, it is useful for me to set.with_deferred_spans(false), since I always want those shown. But fordebug_span!, I really want to set.with_deferred_spans(false), since the debugging spans are only relevant when debugging.Would it be possible for me to never defer emitting the
info_span!s, but always defer emitting thedebug_span!s? Something likeHierarchicalLayer::with_deferred_spans(level: LevelFilter).It's probable that I haven't grokked the
tracingdocs properly, and that there's already a clean way to do this by inserting two layers and using filters? Or maybe I'm holding it wrong, and I shouldn't usetracingspans in this manner in the first place?