Trait bp3d_logger::handler::Handler

source ·
pub trait Handler: Send {
    // Required methods
    fn install(&mut self, enable_stdout: &Flag);
    fn write(&mut self, msg: &LogMsg);
    fn flush(&mut self);
}
Expand description

The main handler trait.

Required Methods§

source

fn install(&mut self, enable_stdout: &Flag)

Called when the handler is installed in the async logging thread.

§Arguments
  • enable_stdout: boolean flag to know if printing to stdout is allowed.
source

fn write(&mut self, msg: &LogMsg)

Called when a message is being written.

§Arguments
  • msg: the log message which was emitted as a LogMsg.
source

fn flush(&mut self)

Called when the flush command is received in the async logging thread.

Implementors§