Skip to content

Remove tracing re-export from bevy_utils #17161

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

Conversation

bushrat011899
Copy link
Contributor

@bushrat011899 bushrat011899 commented Jan 5, 2025

Objective

Solution

  • Made bevy_utils::tracing doc(hidden)
  • Re-exported tracing from bevy_log for end-users
  • Added tracing directly to crates that need it.

Testing

  • CI

Migration Guide

If you were importing tracing via bevy::utils::tracing, instead use bevy::log::tracing. Note that many items within tracing are also directly re-exported from bevy::log as well, so you may only need bevy::log for the most common items (e.g., warn!, trace!, etc.). This also applies to the log_once! family of macros.

Notes

  • While this doesn't reduce the line-count in bevy_utils, it further decouples the internal crates from bevy_utils, making its eventual removal more feasible in the future.
  • I have just imported tracing as we do for all dependencies. However, a workspace dependency may be more appropriate for version management.

@bushrat011899 bushrat011899 added D-Trivial Nice and easy! A great choice to get started with Bevy C-Code-Quality A section of code that is hard to understand or change M-Needs-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide A-Utils Utility functions and types X-Contentious There are nontrivial implications that should be thought through S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jan 5, 2025
@alice-i-cecile
Copy link
Member

I have just imported tracing as we do for all dependencies. However, a workspace dependency may be more appropriate for version management.

As @mockersf pointed out to me, the challenge with workspace dependencies is that the features must be shared across all users of the crate. That might be appropriate for tracing, but it's something we should consider (and write down).

@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 S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it labels Jan 5, 2025
@bushrat011899 bushrat011899 added S-Needs-Review Needs reviewer attention (from anyone!) to move forward and removed S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged labels Jan 5, 2025
@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 Jan 5, 2025
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Jan 5, 2025
Merged via the queue into bevyengine:main with commit a371ee3 Jan 5, 2025
34 checks passed
mrchantey pushed a commit to mrchantey/bevy that referenced this pull request Feb 4, 2025
# Objective

- Contributes to bevyengine#11478

## Solution

- Made `bevy_utils::tracing` `doc(hidden)`
- Re-exported `tracing` from `bevy_log` for end-users
- Added `tracing` directly to crates that need it.

## Testing

- CI

---

## Migration Guide

If you were importing `tracing` via `bevy::utils::tracing`, instead use
`bevy::log::tracing`. Note that many items within `tracing` are also
directly re-exported from `bevy::log` as well, so you may only need
`bevy::log` for the most common items (e.g., `warn!`, `trace!`, etc.).
This also applies to the `log_once!` family of macros.

## Notes

- While this doesn't reduce the line-count in `bevy_utils`, it further
decouples the internal crates from `bevy_utils`, making its eventual
removal more feasible in the future.
- I have just imported `tracing` as we do for all dependencies. However,
a workspace dependency may be more appropriate for version management.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Utils Utility functions and types C-Code-Quality A section of code that is hard to understand or change D-Trivial Nice and easy! A great choice to get started with Bevy 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 X-Contentious There are nontrivial implications that should be thought through
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants