From a110e27c4d2183dcbc2ec8eb3fdce1376c344d5b Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Mon, 15 Jan 2024 11:04:16 +0300 Subject: [PATCH] Update flexi_logger --- Cargo.toml | 3 +-- src/lib.rs | 6 +----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c488182..2592ce1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,11 +13,10 @@ version = "0.5.0" [dependencies] cursive_core = "0.3" arraydeque = "0.4" -flexi_logger = "0.22" +flexi_logger = "0.27" lazy_static = "1.4" log = "0.4" unicode-width = "0.1" -time = "0.3.5" [dev-dependencies] cursive = "0.17.0" diff --git a/src/lib.rs b/src/lib.rs index be64b9b..3bb8be4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -346,10 +346,6 @@ pub fn cursive_flexi_logger(siv: &Cursive) -> Box { }) } -use time::{format_description::FormatItem, macros::format_description}; - -const FORMAT: &[FormatItem<'static>] = format_description!("%T%.3f"); - impl LogWriter for CursiveLogWriter { fn write(&self, now: &mut DeferredNow, record: &Record) -> std::io::Result<()> { let color = Color::Dark(match record.level() { @@ -361,7 +357,7 @@ impl LogWriter for CursiveLogWriter { }); let mut line = StyledString::new(); - line.append_styled(format!("{}", now.format(FORMAT)), color); + line.append_styled(format!("{}", now.format("%T%.3f")), color); line.append_plain(format!( " [{}] ", thread::current().name().unwrap_or("(unnamed)"),