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

Implement From<Verbosity> for tracing and log types #128

Merged
merged 1 commit into from
Nov 26, 2024

Conversation

joshka
Copy link
Contributor

@joshka joshka commented Nov 26, 2024

This makes it possible to just directly setup the log filter:

E.g.:

env_logger::Builder::new().filter_level(cli.verbosity.into()).init();
// or
tracing_subscriber::fmt().with_max_level(cli.verbosity).init();

From: #121 (comment)

@joshka joshka mentioned this pull request Nov 26, 2024
@coveralls
Copy link

coveralls commented Nov 26, 2024

Pull Request Test Coverage Report for Build 12023147123

Details

  • 4 of 8 (50.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.09%) to 48.98%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/tracing.rs 0 4 0.0%
Totals Coverage Status
Change from base Build 11938319251: 0.09%
Covered Lines: 48
Relevant Lines: 98

💛 - Coveralls

@joshka joshka force-pushed the jm/into-tracing branch 2 times, most recently from f441759 to 4a213d0 Compare November 26, 2024 03:17
Implement `From<Verbosity>` for `LevelFilter` and `Option<Level>` for
both `log` and `tracing` crates.

This makes it possible to just directly set the log filter:

E.g.:
```rust
env_logger::Builder::new().filter_level(cli.verbosity.into()).init();
// or
tracing_subscriber::fmt().with_max_level(cli.verbosity).init();
```
@epage epage merged commit b04c66e into clap-rs:master Nov 26, 2024
15 checks passed
@joshka joshka deleted the jm/into-tracing branch November 27, 2024 01:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants