🛈 Note: This is pre-release documentation for the upcoming tracing 0.2.0 ecosystem.

For the release documentation, please see docs.rs, instead.

tracing

Macro debug_span

source
macro_rules! debug_span {
    (target: $target:expr, parent: $parent:expr, $name:expr, $($field:tt)*) => { ... };
    (target: $target:expr, parent: $parent:expr, $name:expr) => { ... };
    (parent: $parent:expr, $name:expr, $($field:tt)*) => { ... };
    (parent: $parent:expr, $name:expr) => { ... };
    (target: $target:expr, $name:expr, $($field:tt)*) => { ... };
    (target: $target:expr, $name:expr) => { ... };
    ($name:expr, $($field:tt)*) => { ... };
    ($name:expr) => { ... };
}
Expand description

Constructs a span at the debug level.

Fields and attributes are set using the same syntax as the span! macro.

See the top-level documentation for details on the syntax accepted by this macro.

ยงExamples

debug_span!("my_span");
// is equivalent to:
span!(Level::DEBUG, "my_span");
let span = debug_span!("my span");
span.in_scope(|| {
    // do work inside the span...
});