pub trait LogError<T, E>: Sized {
// Required method
fn log_level_with<F: FnOnce(E) -> String>(
self,
level: Level,
cb: F
) -> Option<T>;
// Provided methods
fn log_error_with<F: FnOnce(E) -> String>(self, cb: F) -> Option<T> { ... }
fn log_warn_with<F: FnOnce(E) -> String>(self, cb: F) -> Option<T> { ... }
fn log_error(self, msg: &str) -> Option<T>
where E: Display { ... }
fn log_error_detail(self, msg: &str) -> Option<T>
where E: Debug { ... }
fn log_warn(self, msg: &str) -> Option<T>
where E: Display { ... }
fn log_warn_detail(self, msg: &str) -> Option<T>
where E: Debug { ... }
}
Required Methods§
Provided Methods§
sourcefn log_error_with<F: FnOnce(E) -> String>(self, cb: F) -> Option<T>
fn log_error_with<F: FnOnce(E) -> String>(self, cb: F) -> Option<T>
log a error message with specific format handler
sourcefn log_warn_with<F: FnOnce(E) -> String>(self, cb: F) -> Option<T>
fn log_warn_with<F: FnOnce(E) -> String>(self, cb: F) -> Option<T>
log a warn message with specific format handler
sourcefn log_error_detail(self, msg: &str) -> Option<T>where
E: Debug,
fn log_error_detail(self, msg: &str) -> Option<T>where E: Debug,
log the error with specific prefix in a detailed format
sourcefn log_warn(self, msg: &str) -> Option<T>where
E: Display,
fn log_warn(self, msg: &str) -> Option<T>where E: Display,
log the error with specific prefix as a warn message
sourcefn log_warn_detail(self, msg: &str) -> Option<T>where
E: Debug,
fn log_warn_detail(self, msg: &str) -> Option<T>where E: Debug,
log the error with specific prefix in a detailed format as a warn message