log_fn

Attribute Macro log_fn 

Source
#[log_fn]
Expand description

Logs function entry with the function name.

This macro injects a trace! call at the start of the function, logging the function name. Unlike [span_fn], it does not measure execution time or track function exit.

§Usage

use micromegas_tracing::prelude::*;

#[log_fn]
fn handle_event(event: Event) {
    // Logs "handle_event" at trace level when called
    process(event);
}

§When to Use

Use log_fn when you only need to know that a function was called, without timing data. Note that log entries are typically more expensive than span events, so for performance instrumentation prefer [span_fn].

log_fn is useful when you want function calls to appear in the log stream rather than the spans/traces stream.