Trait pink::logger::ResultExt

source ·
pub trait ResultExt {
    // Required method
    fn log_err_with_level(self, level: Level, msg: &str) -> Self
       where Self: Sized;

    // Provided method
    fn log_err(self, msg: &str) -> Self
       where Self: Sized { ... }
}
Expand description

An extension for Result<T, E> to log error conveniently.

Required Methods§

source

fn log_err_with_level(self, level: Level, msg: &str) -> Self
where Self: Sized,

Log the the error message with level and a tip msg in front if the Result is Err.

Provided Methods§

source

fn log_err(self, msg: &str) -> Self
where Self: Sized,

Log the the error message with pink::error! with a tip msg in front if the Result is Err.

Implementations on Foreign Types§

source§

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

source§

fn log_err_with_level(self, level: Level, msg: &str) -> Self

Implementors§