Struct simlog::Log[][src]

pub struct Log {
    pub out_display: bool,
    // some fields omitted
}
Expand description

这是一个开箱即用的日志组件

仅需要路径参数和是否在控制台打印,并且是否在控制台打印是pub的,你可以随时修改它

例子

use std::{time, thread};
use flog::Log;
let log = Log::new("./log".to_string(), true);
loop {
   thread::sleep(time::Duration::from_secs(2));
   log.debug(&x);
   log.info(&x);
   log.warn(&x);
   log.error(&x);
   log.fatal(&x);
}

avatar

Fields

out_display: bool

Implementations

Trait Implementations

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.