[][src]Macro observability::span_context

macro_rules! span_context {
    (current, $lvl:expr) => { ... };
    ($span:expr, $lvl:expr) => { ... };
    ($span:expr) => { ... };
    () => { ... };
}

Emit a tracing event with the context of a span.

Usage

  • span_context!() will emit a trace event with the current span.
  • span_context!(current, Level::DEBUG) will emit a debug event with the current span.
  • Pass a span in and emit a trace event:
let span = tracing::debug_span!("my_pan");
span_context!(span)
  • Pass a span in and emit a warn event:
let span = tracing::debug_span!("my_pan");
span_context!(span, tracing::Level::WARN)