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

feat: add additional log levels #123

Merged
merged 3 commits into from
Nov 16, 2024

Conversation

joshka
Copy link
Contributor

@joshka joshka commented Nov 13, 2024

This adds OffLevel, DebugLevel, and TraceLevel to the list of log
levels that can be set as the default log level for the logger.

A new example, log_level.rs, demonstrates how to set the default log
level for Verbosity to something other than the default. It can be run
with cargo run --example=log_level [default level] [flags]. E.g.,:
cargo run --example=log_level off -vvvv will set the default log level
to OffLevel and then apply the verbosity flags to set the log level to
Debug.

Fixes: #122

examples/log_level.rs Fixed Show resolved Hide resolved
examples/log_level.rs Fixed Show resolved Hide resolved
@coveralls
Copy link

coveralls commented Nov 13, 2024

Pull Request Test Coverage Report for Build 11865462674

Details

  • 3 of 8 (37.5%) changed or added relevant lines in 1 file are covered.
  • 5 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-8.2%) to 59.259%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/lib.rs 3 8 37.5%
Files with Coverage Reduction New Missed Lines %
src/lib.rs 5 59.26%
Totals Coverage Status
Change from base Build 11630869252: -8.2%
Covered Lines: 32
Relevant Lines: 54

💛 - Coveralls

src/lib.rs Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Show resolved Hide resolved
@joshka joshka force-pushed the jm/additional-log-levels branch 2 times, most recently from 31517ef to 7f9b94c Compare November 14, 2024 01:28
.github/workflows/ci.yml Outdated Show resolved Hide resolved
This adds `OffLevel`, `DebugLevel`, and `TraceLevel` to the list of log
levels that can be set as the default log level for the logger.

Fixes: clap-rs#122
This commit removes the unnecessary `allow(clippy::exhaustive_structs)`
directives from the `ErrorLevel`, `WarnLevel`, and `InfoLevel` structs
as these are not triggered by the current clippy configuration.
A new example, `log_level.rs`, demonstrates how to set the default log
level for Verbosity to something other than the default. It can be run
with `cargo run --example=log_level [default level] [flags]`. E.g.,:
`cargo run --example=log_level off -vvvv` will set the default log level
to `OffLevel` and then apply the verbosity flags to set the log level to
`Debug`.
@joshka joshka force-pushed the jm/additional-log-levels branch from 7f9b94c to 2192330 Compare November 16, 2024 00:24
@epage
Copy link
Member

epage commented Nov 16, 2024

Thanks!

@epage epage merged commit cdd2901 into clap-rs:master Nov 16, 2024
15 checks passed
@joshka joshka deleted the jm/additional-log-levels branch November 16, 2024 20:04
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.

Add DebugLevel, TraceLevel, OffLevel
3 participants