Skip to content

Commit 910f984

Browse files
authored
log to stderr instead of stdout (#8886)
# Objective - `bevy_log` writes logs to `stdout` (with ANSI formatting), which gets in the way with program output and complicates parsing. - Closes #8869 ## Solution - Change `bevy_log` to write to `stderr` instead of `stdout` --- ## Changelog Changed: - Logs write to `stderr` rather than `stdout` on desktop targets ## Migration Guide - Capture logs from `stderr` instead of from `stdout` - Use `2> output.log` on the command line to save `stderr` to a file
1 parent 50c50cd commit 910f984

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/bevy_log/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ impl Plugin for LogPlugin {
159159
#[cfg(feature = "tracing-tracy")]
160160
let tracy_layer = tracing_tracy::TracyLayer::new();
161161

162-
let fmt_layer = tracing_subscriber::fmt::Layer::default();
162+
let fmt_layer = tracing_subscriber::fmt::Layer::default().with_writer(std::io::stderr);
163163

164164
// bevy_render::renderer logs a `tracy.frame_mark` event every frame
165165
// at Level::INFO. Formatted logs should omit it.

0 commit comments

Comments
 (0)