From 910f984709fb58cddbb7393c948634a2540e8d72 Mon Sep 17 00:00:00 2001 From: helvieq499 <73959954+helvieq499@users.noreply.github.com> Date: Mon, 19 Jun 2023 19:36:02 -0400 Subject: [PATCH] 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 --- crates/bevy_log/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bevy_log/src/lib.rs b/crates/bevy_log/src/lib.rs index 8f8e841d30..a912d7d984 100644 --- a/crates/bevy_log/src/lib.rs +++ b/crates/bevy_log/src/lib.rs @@ -159,7 +159,7 @@ impl Plugin for LogPlugin { #[cfg(feature = "tracing-tracy")] let tracy_layer = tracing_tracy::TracyLayer::new(); - let fmt_layer = tracing_subscriber::fmt::Layer::default(); + let fmt_layer = tracing_subscriber::fmt::Layer::default().with_writer(std::io::stderr); // bevy_render::renderer logs a `tracy.frame_mark` event every frame // at Level::INFO. Formatted logs should omit it.