Skip to main content

rivet_logger/logger/
handler.rs

1use super::{BoxError, LogRecord};
2
3pub trait Handler: Send + Sync {
4    fn is_handling(&self, _record: &LogRecord) -> bool {
5        true
6    }
7
8    /// Returning true stops bubbling the record through remaining handlers.
9    fn handle(&self, record: LogRecord) -> Result<bool, BoxError>;
10
11    fn close(&self) -> Result<(), BoxError> {
12        Ok(())
13    }
14
15    fn reset(&self) -> Result<(), BoxError> {
16        Ok(())
17    }
18}