Trait TryLog

Source
pub trait TryLog: Log {
    // Required method
    fn try_log(&self, _: &Record<'_>) -> Result<(), ()>;
}
Expand description

Fallible, panic-free version of the log::Log trait.

The intention is actually that implementors of this trait also implement log::Log in a panic-free fashion, and simply drop logs that can’t be logged. Because, if the user can handle the error, they would be using the fallible macros, and if not, they most likely do not want to crash.

Required Methods§

Source

fn try_log(&self, _: &Record<'_>) -> Result<(), ()>

Fallible logging call (fails when buffer is full)

Implementors§