Skip to main content

debug

Macro debug 

Source
debug!() { /* proc-macro */ }
Expand description

Emits a debug-level event.

An optional first argument may provide an error implementing ErrorReport. Its display value and source chain are recorded as exception.message; callers do not provide that attribute themselves.

The event name is required and must be a string literal. When an error is provided, optional target: and parent: arguments go between the error and name, in that order. Without an error, they precede the name. Attributes follow the name and must use a registered field name and a value implementing RecordAttribute. Append #[nonstandard] to a field value to permit an unregistered name while retaining its canonical encoding. Tracing format specifiers and trailing commas are not supported.

The name is recorded as tracing’s message field, which the OpenTelemetry tracing layer uses as the event name.

use miden_node_utils::tracing::debug;

debug!("block.queued", block.number = 42_u32);

let source = std::io::Error::other("upstream unavailable");
debug!(&source, "block.retrying", block.number = 42_u32);