pub trait LogDebugErr<T, E: Debug> {
// Required method
fn err_debug_log(self, level: Level) -> Self;
// Provided method
fn log_debug_err(self) -> Self
where Self: Sized { ... }
}Expand description
Logs debug-formatted errors when debug assertions are enabled.
Successful values pass through without producing a record. With debug assertions disabled, errors also pass through without producing a record.
Required Methods§
Sourcefn err_debug_log(self, level: Level) -> Self
fn err_debug_log(self, level: Level) -> Self
Logs a debug-formatted error at level and returns the original result.
The error is formatted with Debug when debug assertions are enabled.
Successful values always produce no log record.
Provided Methods§
Sourcefn log_debug_err(self) -> Selfwhere
Self: Sized,
fn log_debug_err(self) -> Selfwhere
Self: Sized,
Logs a debug-formatted error at the error tracing level.
LogDebugErr::err_debug_log supplies this convenience form with
Level::ERROR. Logging occurs only when debug assertions are enabled,
and 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".