chore: remove unused code & update log (#5194)

* chore: remove unused code & update log

* chore: clippy

* chore: log
This commit is contained in:
Nathan.fooo
2024-04-24 08:47:33 +08:00
committed by GitHub
parent 275d0b2ac4
commit 9aaada961f
16 changed files with 52 additions and 91 deletions

View File

@ -1,3 +1,4 @@
use chrono::Local;
use std::{fmt, io::Write};
use serde::ser::{SerializeMap, Serializer};
@ -45,7 +46,7 @@ where
) -> Result<(), std::io::Error> {
map_serializer.serialize_entry(MESSAGE, &message)?;
// map_serializer.serialize_entry(LEVEL, &format!("{}", level))?;
// map_serializer.serialize_entry(TIME, &chrono::Utc::now().timestamp())?;
map_serializer.serialize_entry(TIME, &Local::now().format("%Y-%m-%d %H:%M:%S").to_string())?;
Ok(())
}

View File

@ -114,12 +114,9 @@ impl<'a> MakeWriter<'a> for DebugStdoutWriter {
type Writer = Box<dyn Write>;
fn make_writer(&'a self) -> Self::Writer {
#[cfg(not(debug_assertions))]
{
if std::env::var("DISABLE_EVENT_LOG").unwrap_or("false".to_string()) == "true" {
Box::new(io::sink())
}
#[cfg(debug_assertions)]
{
} else {
Box::new(io::stdout())
}
}