Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

log to stderr instead of stdout #8886

Merged
merged 1 commit into from
Jun 20, 2023

Conversation

helvieq499
Copy link
Contributor

@helvieq499 helvieq499 commented Jun 18, 2023

Objective

  • bevy_log writes logs to stdout (with ANSI formatting), which gets in the way with program output and complicates parsing.
  • Closes Logging to stderr #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

@github-actions
Copy link
Contributor

Welcome, new contributor!

Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨

@helvieq499
Copy link
Contributor Author

I only checked on Windows, but the change is trivial and should work on Linux & macOS.

If there is a better term than "desktop targets" I will edit the changelog to use it instead.

@alice-i-cecile alice-i-cecile added C-Bug An unexpected or incorrect behavior C-Usability A targeted quality-of-life change that makes Bevy easier to use A-Diagnostics Logging, crash handling, error reporting and performance analysis labels Jun 18, 2023
Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a better solution, and the motivation in the linked issue is good. Let's see if anyone chimes in with an argument not to do this.

@alice-i-cecile alice-i-cecile added the M-Needs-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide label Jun 18, 2023
@github-actions
Copy link
Contributor

It looks like your PR is a breaking change, but you didn't provide a migration guide.

Could you add some context on what users should update when this change get released in a new version of Bevy?
It will be used to help writing the migration guide for the version. Putting it after a ## Migration Guide will help it get automatically picked up by our tooling.

@helvieq499
Copy link
Contributor Author

Would a migration section in the PR be appropriate?
The changes that need to be made as a result of this are outside of the program itself (e.g. piping/redirecting to a file)

@alice-i-cecile
Copy link
Member

Yeah, a tiny migration guide would be helpful still to point users in the right direction :)

@james7132 james7132 added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Jun 19, 2023
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Jun 19, 2023
Merged via the queue into bevyengine:main with commit 910f984 Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Diagnostics Logging, crash handling, error reporting and performance analysis C-Bug An unexpected or incorrect behavior C-Usability A targeted quality-of-life change that makes Bevy easier to use M-Needs-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Logging to stderr
3 participants