Skip to content

Commit f52c624

Browse files
committed
fix: file logging
1 parent 77960c6 commit f52c624

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

crates/common/src/utils.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,6 @@ pub fn initialize_tracing_log(module_id: &str) -> WorkerGuard {
140140
.unwrap_or(false);
141141

142142
if use_file_logs {
143-
let (writer, guard) = tracing_appender::non_blocking(std::io::stdout());
144-
let stdout_layer = tracing_subscriber::fmt::layer()
145-
.with_target(false)
146-
.with_writer(writer)
147-
.with_filter(stdout_filter);
148-
tracing_subscriber::registry().with(stdout_layer).init();
149-
guard
150-
} else {
151143
// Log all events to a rolling log file.
152144
let mut builder =
153145
tracing_appender::rolling::Builder::new().filename_prefix(module_id.to_lowercase());
@@ -178,6 +170,14 @@ pub fn initialize_tracing_log(module_id: &str) -> WorkerGuard {
178170

179171
tracing_subscriber::registry().with(stdout_layer.and_then(file_layer)).init();
180172
guard
173+
} else {
174+
let (writer, guard) = tracing_appender::non_blocking(std::io::stdout());
175+
let stdout_layer = tracing_subscriber::fmt::layer()
176+
.with_target(false)
177+
.with_writer(writer)
178+
.with_filter(stdout_filter);
179+
tracing_subscriber::registry().with(stdout_layer).init();
180+
guard
181181
}
182182
}
183183

0 commit comments

Comments
 (0)