diff --git a/Cargo.toml b/Cargo.toml index f34f025..79ed93f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ members = [ [package] name = "fast_log" -version = "1.6.8" +version = "1.6.9" description = "Rust async log High-performance asynchronous logging" readme = "Readme.md" authors = ["ce "] @@ -35,4 +35,5 @@ parking_lot = "0.12" zip = { version = "0.6", optional = true } lz4_flex = { version = "0.11", optional = true } flate2 = { version = "1.0", optional = true} -memmap2 = {version = "0.7.1", optional = true} \ No newline at end of file +memmap2 = {version = "0.9.0", optional = true} + diff --git a/benches/log_mmap.rs b/benches/log_mmap.rs deleted file mode 100644 index bb44df2..0000000 --- a/benches/log_mmap.rs +++ /dev/null @@ -1,33 +0,0 @@ -#![feature(test)] -#![feature(bench_black_box)] -extern crate test; - -use fast_log::Config; - -use fast_log::consts::LogSize; -use fast_log::plugin::file_mmap::MmapFile; -use fast_log::plugin::file_split::KeepType; -use fast_log::plugin::packer::LogPacker; -use test::{black_box, Bencher}; - -// 90 ns/iter (+/- 1065) -#[bench] -fn bench_log_mmap(b: &mut Bencher) { - fast_log::init( - Config::new() - .chan_len(Some(100000)) - .console() - .split::( - "target/logs/temp.log", - LogSize::MB(100), - KeepType::All, - LogPacker {}, - ), - ) - .unwrap(); - b.iter(|| { - black_box({ - log::info!("Commencing yak shaving"); - }); - }); -} diff --git a/example/src/split_log_mmap.rs b/example/src/split_log_mmap.rs index 367a39e..119c3b2 100644 --- a/example/src/split_log_mmap.rs +++ b/example/src/split_log_mmap.rs @@ -9,14 +9,14 @@ fn main() { Config::new() .chan_len(Some(100000)) .console() - .split::( + .split::( "target/logs/temp.log", LogSize::MB(1), KeepType::All, LogPacker {}, ), ) - .unwrap(); + .unwrap(); for _ in 0..40000 { log::info!("Commencing yak shaving"); } diff --git a/src/formats.rs b/src/formats.rs index 5f5f6b6..c5de30b 100644 --- a/src/formats.rs +++ b/src/formats.rs @@ -28,8 +28,7 @@ impl RecordFormat for FastLogFormat { fastdate::DateTime::from(arg.now).set_offset(fastdate::offset_sec()) } TimeType::Utc => fastdate::DateTime::from(arg.now), - } - .to_string(); + }; if arg.level.to_level_filter() <= self.display_line_level { arg.formated = format!( "{:27} {} {}:{} {}\n",