pub struct CompositeLogger { /* private fields */ }Expand description
A composite logger that writes to multiple backends.
Implementations§
Source§impl CompositeLogger
impl CompositeLogger
Sourcepub fn new(config: AuditConfig) -> Self
pub fn new(config: AuditConfig) -> Self
Create a new composite logger.
Sourcepub fn add_logger(self, logger: Arc<dyn AuditLogger>) -> Self
pub fn add_logger(self, logger: Arc<dyn AuditLogger>) -> Self
Add a logger backend.
Sourcepub fn with_logger(&mut self, logger: Arc<dyn AuditLogger>)
pub fn with_logger(&mut self, logger: Arc<dyn AuditLogger>)
Add a logger backend by reference.
Trait Implementations§
Source§impl AuditLogger for CompositeLogger
impl AuditLogger for CompositeLogger
Source§fn log<'life0, 'async_trait>(
&'life0 self,
event: AuditEvent,
) -> Pin<Box<dyn Future<Output = Result<(), AuditError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn log<'life0, 'async_trait>(
&'life0 self,
event: AuditEvent,
) -> Pin<Box<dyn Future<Output = Result<(), AuditError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Log an audit event.
Source§fn flush<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), AuditError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn flush<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), AuditError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Flush any buffered events.
Source§fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), AuditError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), AuditError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Check if the logger is healthy.
Auto Trait Implementations§
impl Freeze for CompositeLogger
impl !RefUnwindSafe for CompositeLogger
impl Send for CompositeLogger
impl Sync for CompositeLogger
impl Unpin for CompositeLogger
impl UnsafeUnpin for CompositeLogger
impl !UnwindSafe for CompositeLogger
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more