From f088de5947f6b467171a1f1950239761d525b544 Mon Sep 17 00:00:00 2001 From: Petros Amoiridis Date: Thu, 19 Jan 2023 19:05:17 +0200 Subject: [PATCH] Add date to the log format Co-Authored-By: Mikayla --- crates/zed/src/main.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/crates/zed/src/main.rs b/crates/zed/src/main.rs index 6baf08b01e..16fd0c1eea 100644 --- a/crates/zed/src/main.rs +++ b/crates/zed/src/main.rs @@ -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"); } }