pub struct ActivityLogger { /* private fields */ }Expand description
Activity logging service.
Implementations§
Source§impl ActivityLogger
impl ActivityLogger
Sourcepub fn log(&self, activity_type: ActivityType, description: &str) -> String
pub fn log(&self, activity_type: ActivityType, description: &str) -> String
Log a new activity.
Sourcepub fn log_query(&self, sql: &str, duration_ms: u64, user: Option<&str>)
pub fn log_query(&self, sql: &str, duration_ms: u64, user: Option<&str>)
Log a query activity with duration.
Sourcepub fn log_config(&self, description: &str, user: Option<&str>)
pub fn log_config(&self, description: &str, user: Option<&str>)
Log a configuration change.
Sourcepub fn log_system(&self, description: &str)
pub fn log_system(&self, description: &str)
Log a system event.
Sourcepub fn log_with_details(
&self,
activity_type: ActivityType,
description: &str,
duration: Option<u64>,
user: Option<&str>,
source: Option<&str>,
details: Option<Value>,
) -> String
pub fn log_with_details( &self, activity_type: ActivityType, description: &str, duration: Option<u64>, user: Option<&str>, source: Option<&str>, details: Option<Value>, ) -> String
Log an activity with full details.
Sourcepub fn get_recent(&self, limit: usize) -> Vec<Activity>
pub fn get_recent(&self, limit: usize) -> Vec<Activity>
Get recent activities.
Sourcepub fn get_by_type(
&self,
activity_type: ActivityType,
limit: usize,
) -> Vec<Activity>
pub fn get_by_type( &self, activity_type: ActivityType, limit: usize, ) -> Vec<Activity>
Get activities by type.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ActivityLogger
impl !RefUnwindSafe for ActivityLogger
impl Send for ActivityLogger
impl Sync for ActivityLogger
impl Unpin for ActivityLogger
impl UnwindSafe for ActivityLogger
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