Skip to content

Conversation

@natepiano
Copy link
Contributor

@natepiano natepiano commented Jan 22, 2026

Objective

Fixes #22635

Camera order ambiguity warnings currently fire every frame, flooding the console.

Solution

  • Change warn! to warn_once! in sort_cameras so the warning only fires once per ambiguity
  • Remove the log filter workaround from ui_target_camera example since the warning is no longer spammy

Testing

Ran the ui_target_camera example and triggered a camera order ambiguity by clicking to give two cameras the same order. Verified the warning appears exactly once in the logs despite running for many frames afterward.

@alice-i-cecile alice-i-cecile added D-Trivial Nice and easy! A great choice to get started with Bevy A-Rendering Drawing game state to the screen C-Usability A targeted quality-of-life change that makes Bevy easier to use labels Jan 22, 2026
@alice-i-cecile alice-i-cecile added the S-Needs-Review Needs reviewer attention (from anyone!) to move forward label Jan 22, 2026
@alice-i-cecile alice-i-cecile added S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged 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 S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged labels Jan 22, 2026
@IceSentry
Copy link
Contributor

Would you be interested in doing the bevy_log dependency in a separate PR and also remove all the direct tracing usage we have in bevy_render? That's a weird quirk that we've had for a long time but nobody needed bevy_log directly until now.

@natepiano
Copy link
Contributor Author

Would you be interested in doing the bevy_log dependency in a separate PR and also remove all the direct tracing usage we have in bevy_render? That's a weird quirk that we've had for a long time but nobody needed bevy_log directly until now.

Just so i'm clear - split this so that adding bevy_log dependency is completely by itself and then a separate PR to remove direct tracing? I don't mind doing it but just want to make sure I understand the request.

@IceSentry
Copy link
Contributor

You can add bevy_log and remove direct tracing usage in the same PR because those things are directly related I think. I mostly just want this current PR to not have that noise.

@natepiano
Copy link
Contributor Author

You can add bevy_log and remove direct tracing usage in the same PR because those things are directly related I think. I mostly just want this current PR to not have that noise.

I'm working on the PR for just replacing tracing with bevy_log but ran up against one issue -

bevy_render/src/renderer/mod.rs has a reference to tracing::event! here:

        #[cfg(feature = "tracing-tracy")]
        tracing::event!(
            bevy_log::Level::INFO,
            message = "finished frame",
            tracy.frame_mark = true
        );

tracing::event! is not re-exported from bevy_log - any concern if i add it to the list of re-exports from bevy_log?

pub use tracing::{
    self, debug, debug_span, error, error_span, event, info, info_span, trace, trace_span, warn,
    warn_span, Level,
};

it compiles and i think matches the intent of your ask

@natepiano
Copy link
Contributor Author

just added #22652 PR with the replacement of tracing - once that merges i can rebase this PR on top of it

Copy link
Contributor

@IceSentry IceSentry left a comment

Choose a reason for hiding this comment

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

I would wait on the tracing PR to merge and then update the description of this PR but other than that LGTM

github-merge-queue bot pushed a commit that referenced this pull request Jan 23, 2026
## Objective

Replace direct `tracing` dependency with `bevy_log` in `bevy_render` for
consistency with other bevy crates.

This was split out from #22649 at @IceSentry's request.

## Solution

- Add `bevy_log` dependency to `bevy_render`
- Replace all `use tracing::*` imports with `use bevy_log::*`
- Remove `tracing` dependency from `bevy_render`
- Add `event` to `bevy_log`'s tracing re-exports (needed by
`renderer/mod.rs`)

## Testing

Built with `--all-features` and ran `3d_scene` example.

---------

Co-authored-by: Alice Cecile <[email protected]>
Co-authored-by: IceSentry <[email protected]>
@github-actions
Copy link
Contributor

You added a new example but didn't add metadata for it. Please update the root Cargo.toml file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Rendering Drawing game state to the screen C-Usability A targeted quality-of-life change that makes Bevy easier to use D-Trivial Nice and easy! A great choice to get started with Bevy S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Camera ambiguity warnings shouldn't run every frame

3 participants