skyfffire 2 жил өмнө
parent
commit
8bcaa0af84

+ 3 - 3
global/src/log_utils.rs

@@ -1,7 +1,7 @@
 use std::collections::HashMap;
 use std::fmt::Debug;
 use std::io;
-use chrono::{Datelike, Timelike, Utc};
+use chrono::{Datelike, FixedOffset, Timelike, Utc};
 use tracing::{Event, Subscriber, warn};
 use tracing_appender::non_blocking::WorkerGuard;
 use tracing_subscriber::{fmt, Layer};
@@ -17,10 +17,10 @@ struct LocalTimer;
 
 impl FormatTime for LocalTimer {
     fn format_time(&self, w: &mut Writer<'_>) -> std::fmt::Result {
-        let now = Utc::now();
+        let now = Utc::now().with_timezone(&FixedOffset::east_opt(8 * 3600).unwrap());
         write!(
             w,
-            "{:02}-{:02} {:02}:{:02}:{:02}.{}",
+            "{:04}-{:02} {:02}:{:02}:{:02}.{:03}",
             now.month(),
             now.day(),
             now.hour(),