pub trait ErrDebugLog<T, E>where
E: Debug,{
// Required method
fn log_err_debug(self, level: Level) -> Self;
// Provided method
fn err_debug_log(self) -> Self
where Self: Sized { ... }
}Expand description
Logs debug-formatted errors while preserving their result.
Successful values pass through without producing a log record. Error values are inspected at the requested tracing level and remain unchanged.
Required Methods§
Sourcefn log_err_debug(self, level: Level) -> Self
fn log_err_debug(self, level: Level) -> Self
Logs an error at level and returns the original result.
The error is formatted with fmt::Debug. An Ok value produces no
record and is returned unchanged.
Provided Methods§
Sourcefn err_debug_log(self) -> Selfwhere
Self: Sized,
fn err_debug_log(self) -> Selfwhere
Self: Sized,
Logs a debug-formatted error at the error tracing level.
ErrDebugLog::log_err_debug supplies this convenience form with
Level::ERROR. The original result is returned after inspection.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".