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

CLI: switch to dedicated logging crate #236

Closed
DaAlbrecht opened this issue Jan 19, 2025 · 1 comment · Fixed by #282
Closed

CLI: switch to dedicated logging crate #236

DaAlbrecht opened this issue Jan 19, 2025 · 1 comment · Fixed by #282
Labels
A-CLI Related to the main CLI and not a more specific subcommand D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-for-Implementation This issue is ready for an implementation PR. Go for it!

Comments

@DaAlbrecht
Copy link
Collaborator

A dedicated logging crate would be helpful to support options like --quite or --verbose. Additionally it would help to make the output messages more consistent.

@TimJentzsch TimJentzsch added A-CLI Related to the main CLI and not a more specific subcommand X-Uncontroversial D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-for-Implementation This issue is ready for an implementation PR. Go for it! labels Jan 20, 2025
@TimJentzsch
Copy link
Collaborator

Logging crates currently used in Bevy:

  • tracing, which also can do a lot more than just logging.
  • log, which appears to be more light-weight. Used in Bevy for no_std support.

DaAlbrecht added a commit that referenced this issue Feb 26, 2025
# Objective

For features like #275 a
dedicated logging crate would be helpful to implement `-v`/`--verbose`.

# Solution

I opted for `tracing` instead of `log` even though it's a bit overkill
for us at the moment. `tracing` seems to be the most flexible and is
also mostly used in `bevy`. But I don't really have a strong opinion on
this.

# Testing

```sh
❯ bevy run web
2025-02-24T21:49:19.817751Z  INFO bevy_cli::build: Compiling to WebAssembly...
    Finished `web` profile [unoptimized + debuginfo] target(s) in 0.11s
2025-02-24T21:49:19.970038Z  INFO bevy_cli::build: Bundling JavaScript bindings...
2025-02-24T21:49:22.969352Z  INFO bevy_cli::web::bundle: No custom `web` folder found, using defaults.
2025-02-24T21:49:22.969406Z  INFO bevy_cli::run: Open your app at <http://localhost:4000>!
```
```sh
❯ export RUST_LOG="bevy_cli=error"
❯ bevy run web
    Finished `web` profile [unoptimized + debuginfo] target(s) in 0.15s
```
Closes #236

---------

Co-authored-by: BD103 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-CLI Related to the main CLI and not a more specific subcommand D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-for-Implementation This issue is ready for an implementation PR. Go for it!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants