pub struct Logger { /* private fields */ }Expand description
Logger
Implementations§
Source§impl Logger
impl Logger
Sourcepub fn should_log(&self, level: &LogLevel) -> bool
pub fn should_log(&self, level: &LogLevel) -> bool
Check if logging should be performed for the specified level
Sourcepub fn log_safe<F>(
&self,
level: LogLevel,
message_fn: F,
sensitive_data: Option<&str>,
)
pub fn log_safe<F>( &self, level: LogLevel, message_fn: F, sensitive_data: Option<&str>, )
Safely log messages with lazy evaluation (decides whether to record sensitive information based on configuration)
Sourcepub fn log_api_start(
&self,
request_id: &str,
api_name: &str,
params_count: usize,
fields_count: usize,
)
pub fn log_api_start( &self, request_id: &str, api_name: &str, params_count: usize, fields_count: usize, )
Log API call start
Sourcepub fn log_request_details(
&self,
request_id: &str,
api_name: &str,
params: &str,
fields: &str,
token_preview: Option<&str>,
)
pub fn log_request_details( &self, request_id: &str, api_name: &str, params: &str, fields: &str, token_preview: Option<&str>, )
Log request details
Sourcepub fn log_http_request(&self, request_id: &str)
pub fn log_http_request(&self, request_id: &str)
Log HTTP request sending
Sourcepub fn log_http_error(&self, request_id: &str, elapsed: Duration, error: &str)
pub fn log_http_error(&self, request_id: &str, elapsed: Duration, error: &str)
Log HTTP request failure
Sourcepub fn log_http_response(&self, request_id: &str, status_code: u16)
pub fn log_http_response(&self, request_id: &str, status_code: u16)
Log HTTP response reception
Sourcepub fn log_response_read_error(
&self,
request_id: &str,
elapsed: Duration,
error: &str,
)
pub fn log_response_read_error( &self, request_id: &str, elapsed: Duration, error: &str, )
Log response reading failure
Sourcepub fn log_raw_response(&self, request_id: &str, response_text: &str)
pub fn log_raw_response(&self, request_id: &str, response_text: &str)
Log raw response content
Sourcepub fn log_json_parse_error(
&self,
request_id: &str,
elapsed: Duration,
error: &str,
response_text: &str,
)
pub fn log_json_parse_error( &self, request_id: &str, elapsed: Duration, error: &str, response_text: &str, )
Log JSON parsing failure
Sourcepub fn log_api_error(
&self,
request_id: &str,
elapsed: Duration,
code: i32,
message: &str,
)
pub fn log_api_error( &self, request_id: &str, elapsed: Duration, code: i32, message: &str, )
Log API error
Sourcepub fn log_api_success(
&self,
request_id: &str,
elapsed: Duration,
data_count: usize,
)
pub fn log_api_success( &self, request_id: &str, elapsed: Duration, data_count: usize, )
Log API call success
Sourcepub fn log_response_details(
&self,
request_id: &str,
response_request_id: &str,
fields: &str,
)
pub fn log_response_details( &self, request_id: &str, response_request_id: &str, fields: &str, )
Log response details
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Logger
impl RefUnwindSafe for Logger
impl Send for Logger
impl Sync for Logger
impl Unpin for Logger
impl UnwindSafe for Logger
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