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

chore: Replace dbg! call with trace! in src/asset.rs #54

Merged
merged 5 commits into from
Dec 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

## [unreleased]

## v0.4.2

### Changed

- Removed the `dbg!` macro from the codebase and replaced it with `trace!` (#54)

### Documentation

- Added a note about the `logging` and `tracing` features in the debugging guide (#54)

## v0.4.1

### Changed
Expand Down
18 changes: 18 additions & 0 deletions book/src/guides/debug.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,21 @@ fn main() {
```

And you also need to enable either the `debug-render-2d` feature on `bevy_rapier2d` crate or the `rapier_debug` feature on `bevy_ecs_tiled`

## Logging

Bevy uses the `tracing` crate for logging, which is very powerful in debugging and profiling, you can find more information in the [official documentation](https://docs.rs/tracing/).

We recommend to enable the `trace` level in your application to get more informations about what's happening, just set the `RUST_LOG` environment variable to `trace`:

```sh
RUST_LOG=trace cargo run
```

But this will be very verbose, so you can also filter the logs to only display the informations you need:

```sh
RUST_LOG=bevy_ecs_tiled=trace cargo run
```

This will only display logs from the `bevy_ecs_tiled` crate in `trace` level.
4 changes: 2 additions & 2 deletions src/asset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ impl<'a, 'b> BytesResourceReader<'a, 'b> {
}
}

impl<'a, 'b> tiled::ResourceReader for BytesResourceReader<'a, 'b> {
impl<'a> tiled::ResourceReader for BytesResourceReader<'a, '_> {
type Resource = Box<dyn Read + 'a>;
type Error = IoError;

Expand Down Expand Up @@ -164,7 +164,7 @@ impl AssetLoader for TiledLoader {
DeserializedMapProperties::load(&map, self.registry.read().deref(), load_context);

#[cfg(feature = "user_properties")]
dbg!(&properties);
trace!(?properties, "user properties");

let asset_map = TiledMap {
map,
Expand Down
Loading