pub struct FileLogger { /* private fields */ }Expand description
A simple file-based audit logger.
Writes audit events as human-readable text lines to a file.
Implementations§
Source§impl FileLogger
impl FileLogger
Sourcepub async fn new(
path: impl Into<PathBuf>,
config: AuditConfig,
) -> Result<Self, AuditError>
pub async fn new( path: impl Into<PathBuf>, config: AuditConfig, ) -> Result<Self, AuditError>
Create a new file logger.
Trait Implementations§
Source§impl AuditLogger for FileLogger
impl AuditLogger for FileLogger
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 FileLogger
impl !RefUnwindSafe for FileLogger
impl Send for FileLogger
impl Sync for FileLogger
impl Unpin for FileLogger
impl UnsafeUnpin for FileLogger
impl UnwindSafe for FileLogger
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