Skip to main content

module_log

Macro module_log 

Source
macro_rules! module_log {
    (info, $($arg:tt)+) => { ... };
    (warn, $($arg:tt)+) => { ... };
    (error, $($arg:tt)+) => { ... };
}
Expand description

Emit a log line from module code on every runtime (issue #846).

On Workers no tracing dispatcher can be installed (see runtime-cloudflare’s tracing_setup), so a bare tracing::info! from module code is dropped there. module_log! routes the line through the control-event forwarder to Workers Logs instead, and natively it emits a normal tracing event. Both paths run the formatted line through scrub_text, the same redaction rules every log field gets.

module_log!(info, "stored {} rows", n);

Levels: info, warn, error. Never log user text or message bodies — metadata only; the redaction pipeline is a backstop, not permission.