Skip to content

Allow deferring based on level? #94

Description

@madsmtm

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions