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

Log invocations of external commands #275

Open
TimJentzsch opened this issue Feb 16, 2025 · 0 comments · May be fixed by #290
Open

Log invocations of external commands #275

TimJentzsch opened this issue Feb 16, 2025 · 0 comments · May be fixed by #290
Labels
A-CLI Related to the main CLI and not a more specific subcommand C-Usability An improvement that makes the API more pleasant D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes S-Ready-for-Implementation This issue is ready for an implementation PR. Go for it!

Comments

@TimJentzsch
Copy link
Collaborator

One goal of the Bevy CLI is to be fully optional.
That means that a user should be able to fully replicate the behavior of the CLI by external commands, even though it might be a lot less user-friendly.

To make this easier, we should log the invocations of all commands and the arguments that were used.
Ideally, we would put this behind a --verbose flag to not spam the output by default.

#236 will likely simplify the implementation.

Probably not a blocker for TheBevyFlock/bevy_new_2d#312, but it was requested by the template authors.

@TimJentzsch TimJentzsch added A-CLI Related to the main CLI and not a more specific subcommand C-Usability An improvement that makes the API more pleasant D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes S-Ready-for-Implementation This issue is ready for an implementation PR. Go for it! X-Uncontroversial labels Feb 16, 2025
@TimJentzsch TimJentzsch added this to the `bevy_cli` 0.1.0 milestone Feb 16, 2025
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]>
@DaAlbrecht DaAlbrecht linked a pull request Feb 26, 2025 that will close this issue
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 C-Usability An improvement that makes the API more pleasant D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes 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.

2 participants