Rust用例
添加ezlog依赖
在Cargo.toml中添加依赖
[dependencies]
ezlog = "0.2"
示例
#![allow(unused)] fn main() { use ezlog::EZLogConfigBuilder; use ezlog::Level; use log::{error, info, warn}; use log::{LevelFilter, Log}; ezlog::InitBuilder::new().init(); let config = EZLogConfigBuilder::new() .level(Level::Trace) .dir_path( dirs::download_dir() .unwrap() .into_os_string() .into_string() .expect("dir path error"), ) .build(); ezlog::create_log(config); info!("hello ezlog"); }
在examples文件夹中查看更多示例