Skip to main content

error_debounce

Macro error_debounce 

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

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

// Will log at most once per 10 seconds from this line
error_debounce!(Duration::from_secs(10), "Database error: {}", error);