Skip to main content

LogDebugErr

Trait LogDebugErr 

Source
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§

Source

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§

Source

fn log_debug_err(self) -> Self
where 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".

Implementors§

Source§

impl<T, E: Debug> LogDebugErr<T, E> for Result<T, E>