Skip to main content

debug_debounce

Macro debug_debounce 

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

Logs a message at the debug 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::debug_debounce;
use std::time::Duration;

// Will log at most once per 60 seconds from this line
debug_debounce!(Duration::from_secs(60), "Cache hits: {}", cache_hits);