macro_rules! in_node_context {
($ctx:expr, $body:block) => { ... };
}Expand description
Macro to execute code within a node’s logging context
This macro creates a tracing span with the node_id field, ensuring all logs within the scope are automatically tagged with the node identifier.
§Example
use mecha10::prelude::*;
in_node_context!(ctx, {
info!("Starting processing"); // Will show: node_id=my-node Starting processing
debug!("Details here"); // Will show: node_id=my-node Details here
});