Skip to main content

trace_debounce

Macro trace_debounce 

Source
macro_rules! trace_debounce {
    ($duration:expr, $($arg:tt)*) => { ... };
}
Expand description

Logs a message at the trace level, debounced by duration per callsite.

Subsequent calls to the same callsite within the specified duration will be silently dropped. Each unique location in your code where this macro is invoked maintains its own debounce state.

ยงExample

use log_debounce::trace_debounce;
use std::time::Duration;

// Will log at most once per 100ms from this line
trace_debounce!(Duration::from_millis(100), "Iteration {}", iteration);