pub fn file<P: Into<String>, S: LevelInto>(
path: P,
level: S,
size: u64,
roll_count: u32,
) -> SimpleResult<()>Expand description
Provide init simple-log instance with write file.
The param path is either an absolute path or lacking a leading /, relative to the cwd of your LogConfig.
The param level config log level with [log_level].
The param size config single file size(MB).
The param roll_count config single file size(MB).
The file extension of the pattern is .gz,the archive files will be gzip-compressed.
#[macro_use]
extern crate simple_log;
fn main() -> Result<(), String> {
simple_log::file("./log/file.log", "debug", 100, 10)?;
debug!("test file debug");
info!("test file info");
Ok(())
}