Add date to the log format

Co-Authored-By: Mikayla <mikayla@zed.dev>
This commit is contained in:
Petros Amoiridis 2023-01-19 19:05:17 +02:00
parent 5189dea3d5
commit f088de5947
No known key found for this signature in database

View File

@ -29,6 +29,7 @@ use settings::{
self, settings_file::SettingsFile, KeymapFileContent, Settings, SettingsFileContent,
WorkingDirectory,
};
use simplelog::ConfigBuilder;
use smol::process::Command;
use std::fs::OpenOptions;
use std::{env, ffi::OsStr, panic, path::PathBuf, sync::Arc, thread, time::Duration};
@ -269,8 +270,12 @@ fn init_logger() {
.append(true)
.open(&*paths::LOG)
.expect("could not open logfile");
simplelog::WriteLogger::init(level, simplelog::Config::default(), log_file)
.expect("could not initialize logger");
let config = ConfigBuilder::new()
.set_time_format_str("%Y-%m-%dT%T") //All timestamps are UTC
.build();
simplelog::WriteLogger::init(level, config, log_file).expect("could not initialize logger");
}
}