Skip to content

Commit

Permalink
log to stderr instead of stdout (#8886)
Browse files Browse the repository at this point in the history
# 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
  • Loading branch information
helvieq499 authored Jun 19, 2023
1 parent 50c50cd commit 910f984
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/bevy_log/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 910f984

Please sign in to comment.