From 5c912777c7b9666d7451c50cb914dd8773b8cfa7 Mon Sep 17 00:00:00 2001 From: Federico Terzi Date: Mon, 29 Mar 2021 21:20:33 +0200 Subject: [PATCH] fix(core): use local time instead of UTC in logs. #522 --- espanso/src/main.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/espanso/src/main.rs b/espanso/src/main.rs index cebc73d..97b490b 100644 --- a/espanso/src/main.rs +++ b/espanso/src/main.rs @@ -23,7 +23,7 @@ extern crate lazy_static; use clap::{App, AppSettings, Arg, SubCommand}; use cli::{CliModule, CliModuleArgs}; use logging::FileProxy; -use simplelog::{CombinedLogger, Config, LevelFilter, TermLogger, TerminalMode, WriteLogger}; +use simplelog::{CombinedLogger, ConfigBuilder, LevelFilter, TermLogger, TerminalMode, WriteLogger}; mod cli; mod engine; @@ -211,9 +211,11 @@ fn main() { if let Some(handler) = handler { let log_proxy = FileProxy::new(); if handler.enable_logs { + let config = ConfigBuilder::new().set_time_to_local(true).build(); + CombinedLogger::init(vec![ - TermLogger::new(log_level, Config::default(), TerminalMode::Mixed), - WriteLogger::new(log_level, Config::default(), log_proxy.clone()), + TermLogger::new(log_level, config.clone(), TerminalMode::Mixed), + WriteLogger::new(log_level, config, log_proxy.clone()), ]) .expect("unable to initialize logs"); }