diff --git a/Cargo.toml b/Cargo.toml index fada33b..4fcac7d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "logging" -version = "0.5.0" +version = "0.5.1" authors = ["Jonathan Strong "] edition = "2018" @@ -32,7 +32,8 @@ dirs = "1" crossbeam-channel = "0.3" pretty_toa = "1.0.0" -sloggers = { path = "../sloggers" } +sloggers = "0.3" +#sloggers = { path = "../sloggers" } decimal = { path = "../decimal", version = "2" } diff --git a/src/lib.rs b/src/lib.rs index d91afe8..0478fef 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -64,12 +64,16 @@ pub fn inanos(t: DateTime) -> i64 { } //#[cfg(not(any(test, feature = "test")))] -pub fn file_logger(path: &str, level: Severity) -> slog::Logger { +pub fn file_logger>(path: P, level: Severity) -> slog::Logger { let mut builder = FileLoggerBuilder::new(path); - builder.level(level); - builder.timezone(TimeZone::Utc); - builder.channel_size(CHANNEL_SIZE); - builder.build().unwrap() + builder.level(level) + .timezone(TimeZone::Utc) + .channel_size(CHANNEL_SIZE) + .rotate_size(1024 * 1024 * 1024) + .rotate_keep(1000) + .rotate_compress(true) + .source_location(sloggers::types::SourceLocation::ModuleAndLine); + builder.build().unwrap() // the sloggers impl can't actually fail (v0.3) } pub fn truncating_file_logger(path: &str, level: Severity) -> slog::Logger {