# tracing::error_span - Rust
API documentation for the Rust `error_span` macro in crate `tracing`.
Keywords: rust, rustlang, rust-lang, error_span

# Macro tracing::error_span [−] [src]

    macro_rules! error_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) => { ... };
    }

Constructs a span at the error 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

    error_span!("my_span");
    // is equivalent to:
    span!(Level::ERROR, "my_span");

    let span = error_span!("my span");
    span.in_scope(|| {
        // do work inside the span...
    });