Skip to content

Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.

chore: update log

nathan9b4fd3bf57cf
diff --git a/frontend/rust-lib/lib-log/src/lib.rs b/frontend/rust-lib/lib-log/src/lib.rs
index f8b0762a27..9ab8c88299 100644
--- a/frontend/rust-lib/lib-log/src/lib.rs
+++ b/frontend/rust-lib/lib-log/src/lib.rs
@@ -8,6 +8,7 @@ use tracing_appender::rolling::Rotation;
use tracing_appender::{non_blocking::WorkerGuard, rolling::RollingFileAppender};
use tracing_bunyan_formatter::JsonStorageLayer;
use tracing_subscriber::fmt::format::Writer;
+use tracing_subscriber::fmt::MakeWriter;
use tracing_subscriber::{layer::SubscriberExt, EnvFilter};
use crate::layer::FlowyFormattingLayer;
@@ -87,6 +88,7 @@ impl Builder {
.pretty()
.with_env_filter(env_filter)
.finish()
+ .with(FlowyFormattingLayer::new(StdoutWriter))
.with(JsonStorageLayer)
.with(file_layer);
set_global_default(subscriber).map_err(|e| format!("{:?}", e))?;
@@ -103,3 +105,13 @@ impl tracing_subscriber::fmt::time::FormatTime for CustomTime {
write!(w, "{}", Local::now().format("%Y-%m-%d %H:%M:%S"))
}
}
+
+pub struct StdoutWriter;
+
+impl<'a> MakeWriter<'a> for StdoutWriter {
+ type Writer = std::io::Stdout;
+
+ fn make_writer(&'a self) -> Self::Writer {
+ std::io::stdout()
+ }
+}