Macro log

Source
macro_rules! log {
    (context: $context:expr, $lvl:expr, $($arg:tt)+) => { ... };
    (context: $context:expr, $lvl:expr; $($arg:tt)+) => { ... };
    ($lvl:expr, $($arg:tt)+) => { ... };
}
Expand description

The standard logging macro.

This macro will generically log with the specified Level and format! based argument list.

ยงExamples

use wasmcloud_component::log;
use wasmcloud_component::wasi::logging::logging::Level;

let data = (42, "Forty-two");
let private_data = "private";

log!(Level::Error, "Received errors: {}, {}", data.0, data.1);
log!(context: "app_events", Level::Warn, "App warning: {}, {}, {}",
    data.0, data.1, private_data);