-
Notifications
You must be signed in to change notification settings - Fork 260
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
Allow creation of Level
and LevelFilter
from usize
#460
Comments
Hi @WaDelma 👋 I don't think we want to commit to an integer representation for these and the best approach would be for you to pick one for your use case and map them to |
Given that the types are fn main() {
dbg!(log::LevelFilter::Info as usize);
} So I think it makes sense to expose the associated |
Bumps [clap](https://github.com/clap-rs/clap) from 4.0.8 to 4.0.9. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](clap-rs/clap@v4.0.8...v4.0.9) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Currently
Level::from_usize
andLevelFilter::from_usize
are private and cannot be used outside the crate.I wanted to allow providing number via command line flag and use that to construct
LevelFilter
, but to do that I would need to replicate the code of those methods.The text was updated successfully, but these errors were encountered: