Function init

Source
pub fn init<P>(
    level: LevelFilter,
    base_filename: P,
) -> Result<FlushGuard, LoggestError>
where P: Into<OsString>,
Expand description

Initialize loggest. Must only be called once.

The base_filename argument is used as the name for the main thread. Other threads append .<thread_id>.

ยงExample

loggest::init(log::LevelFilter::max(), env!("CARGO_PKG_NAME")).unwrap();
Examples found in repository?
examples/simple.rs (line 6)
5fn main() {
6    let _flush = init(LevelFilter::Info, "example").unwrap();
7
8    info!("Main thread");
9
10    thread::spawn(move || {
11        info!("A thread");
12    })
13    .join()
14    .unwrap();
15}