From 553ce978d4d13f0b649cbc6321b477ea5808fee1 Mon Sep 17 00:00:00 2001 From: Ryo Yamashita Date: Thu, 9 Mar 2023 01:30:52 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=AD=E3=82=B0=E3=81=AE=E6=99=82=E5=88=BB?= =?UTF-8?q?=E3=82=92=E3=83=9E=E3=82=A4=E3=82=AF=E3=83=AD=E7=A7=92=E5=8D=98?= =?UTF-8?q?=E4=BD=8D=E3=81=AB=E6=8F=83=E3=81=88=E3=82=8B=20(#434)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/voicevox_core_c_api/src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/voicevox_core_c_api/src/lib.rs b/crates/voicevox_core_c_api/src/lib.rs index c09050a71..dc1866579 100644 --- a/crates/voicevox_core_c_api/src/lib.rs +++ b/crates/voicevox_core_c_api/src/lib.rs @@ -2,6 +2,7 @@ mod compatible_engine; mod helpers; use self::helpers::*; +use chrono::SecondsFormat; use is_terminal::IsTerminal; use libc::c_void; use once_cell::sync::Lazy; @@ -41,7 +42,9 @@ static INTERNAL: Lazy> = Lazy::new(|| { } fn local_time(wtr: &mut Writer<'_>) -> fmt::Result { - wtr.write_str(&chrono::Local::now().to_rfc3339()) + // ローカル時刻で表示はするが、そのフォーマットはtracing-subscriber本来のものに近いようにする。 + // https://github.com/tokio-rs/tracing/blob/tracing-subscriber-0.3.16/tracing-subscriber/src/fmt/time/datetime.rs#L235-L241 + wtr.write_str(&chrono::Local::now().to_rfc3339_opts(SecondsFormat::Micros, false)) } fn out() -> impl IsTerminal + Write {