Function simple_log::file [−][src]
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 log;
fn main() -> Result<(), String> {
simple_log::file("./log/file.log", "debug", 100, 10)?;
debug!("test file debug");
info!("test file info");
Ok(())
}