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

Making LogFilter::from_usize() public #318

Closed
elichai opened this issue Jan 31, 2019 · 3 comments
Closed

Making LogFilter::from_usize() public #318

elichai opened this issue Jan 31, 2019 · 3 comments

Comments

@elichai
Copy link

elichai commented Jan 31, 2019

Hi,
I'm using https://github.com/TeXitoi/structopt for CLI arguments and it has a nice feature called from_occurrences that it counts the number of vs when I pass -v and gives me a usize/u8.
I'm using that to select the LevelFilter for my logger.

Right now I have my own match, but it would be nicer if I could use the already existing LogFilter::from_usize() function (here: https://github.com/rust-lang-nursery/log/blob/master/src/lib.rs#L487 ) to convert it.
That way I won't need to worry about future changes to the LogFilter.

What do you think?
Thanks.

@KodrAus
Copy link
Contributor

KodrAus commented Jan 31, 2019

Hi @elichai 👋

I'm not sure that we'll want to commit to those exact values as public in log, they're an internal mechanism that lets us compare a Level to a LevelFilter.

@elichai
Copy link
Author

elichai commented Feb 1, 2019

Hmm Ok, that's too bad.
I do think that other people had to write a function like this too, but thanks anyway :)

@KodrAus
Copy link
Contributor

KodrAus commented Feb 5, 2019

No problem, thanks again for the suggestion! This might be something we could revisit in the future.

@KodrAus KodrAus closed this as completed Feb 5, 2019
EFanZh pushed a commit to EFanZh/log that referenced this issue Jul 23, 2023
* Add new feature `trust-dns` to lib & bin
* Enable `trust-dns` feature by default
   Because the `getaddrinfo` is a poorly designed API.
* USe default feature set on windows CI
   because wintls on the CI does not support TLS 1.3 and trust-dns only
   support dns over https if rustls is used.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
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

No branches or pull requests

2 participants