macro_rules! init {
() => { ... };
($arg1:expr) => { ... };
}Expand description
A macro for initializing the logging system.
§Use
To initialize the logging system without a listener, do not pass any arguments.
To initialize the logging system with a listener, pass a listener implementing LogListener as the first argument.
§Examples
Initialize the logging system without a listener:
use breadcrumbs::init;
init!();Initialize the logging system with a listener:
use breadcrumbs::{init, LogListener};
struct MyLogListener;
impl LogListener for MyLogListener {
fn on_log(&mut self, log: breadcrumbs::Log) {
println!("{}", log);
}
}
init!(MyLogListener);