Skip to content

Don't clobber default filters if env filters exist#23762

Merged
alice-i-cecile merged 2 commits intobevyengine:mainfrom
BigWingBeat:logging
Apr 12, 2026
Merged

Don't clobber default filters if env filters exist#23762
alice-i-cecile merged 2 commits intobevyengine:mainfrom
BigWingBeat:logging

Conversation

@BigWingBeat
Copy link
Copy Markdown
Contributor

Objective

LogPlugin has some default filters which suppress unhelpful noisy logging from dependencies. However, if the RUST_LOG env var is set, it completely discards these default filters in favour of whatever the user set, thus unleashing all of the spammy logging that is usually hidden.

Solution

Refactor the filter setup so that RUST_LOG filter configuration is applied on-top of the default filters, instead of entirely replacing them. The EnvFilter is constructed with the default filters, then any filters from RUST_LOG are parsed and added afterwards, so that they can selectively override the default filters, should the user desire that.

Testing

Manually tested with the logs example and various RUST_LOG values.

@alice-i-cecile alice-i-cecile added C-Bug An unexpected or incorrect behavior A-Diagnostics Logging, crash handling, error reporting and performance analysis D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward X-Uncontroversial This work is generally agreed upon labels Apr 11, 2026
@alice-i-cecile alice-i-cecile added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Apr 12, 2026
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Apr 12, 2026
Merged via the queue into bevyengine:main with commit 9a987fe Apr 12, 2026
40 checks passed
@BigWingBeat BigWingBeat deleted the logging branch April 13, 2026 14:59
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 D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it X-Uncontroversial This work is generally agreed upon

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants