Skip to main content

failure

Macro failure 

Source
macro_rules! failure {
    (target: $target:expr, $failure:expr, $($message:tt)+) => { ... };
    ($failure:expr, $($message:tt)+) => { ... };
}
Expand description

Emit a captured Failure as an error event at the caller’s target and source location.

The error’s causes remain typed; captured backtraces and original span context are included as text fields. Ordinary tracing subscribers can consume this event too. The failure expression is evaluated once. An explicit target: may override the caller’s module path.

let failure = base_console::Failure::capture(std::io::Error::other("disconnected"));
base_console::failure!(failure, "Request {} failed", 42);