default to only logging errors

macos-click-through
Keith Simmons 3 years ago
parent 4131c50cfd
commit cf8b48f5f5

@ -181,17 +181,19 @@ fn main() {
pub fn init_logger() { pub fn init_logger() {
let settings = SETTINGS.get::<CmdLineSettings>(); let settings = SETTINGS.get::<CmdLineSettings>();
let logger = match settings.log_to_file { let logger = if settings.log_to_file {
true => Logger::with_env_or_str("neovide") Logger::with_env_or_str("neovide")
.duplicate_to_stderr(Duplicate::Error)
.log_to_file() .log_to_file()
.rotate( .rotate(
Criterion::Size(10_000_000), Criterion::Size(10_000_000),
Naming::Timestamps, Naming::Timestamps,
Cleanup::KeepLogFiles(1), Cleanup::KeepLogFiles(1),
), )
false => Logger::with_env_or_str(format!("neovide = {}", "trace")), .duplicate_to_stderr(Duplicate::Error)
} else {
Logger::with_env_or_str("neovide = error")
}; };
logger.start().expect("Could not start logger"); logger.start().expect("Could not start logger");
} }

Loading…
Cancel
Save