Skip to main content

ErrDebugLog

Trait ErrDebugLog 

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

Source

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§

Source

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

Implementors§

Source§

impl<T, E> ErrDebugLog<T, E> for Result<T, E>
where E: Debug,