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

Make possible to customize filtering of messages according to crates #71

Open
Dushistov opened this issue Oct 13, 2022 · 0 comments
Open

Comments

@Dushistov
Copy link

There are no clear criteria for separating messages according to the log level.
So some crates log every byte in info level, while other more conveniently move such info to trace level.
As example, in my project I have such config for env_logger:

debug,tokio=warn,request=warn,hyper=warn,
serde_xml_rs=warn,reqwest=warn,trust_dns_proto=warn,
trust_dns_resolver=warn,couchbase=warn 

So it would be nice if it is possible at least filter messages before send them to syslog via crate names.

One of possible variants of solution would be generalize solution from android_logger: https://docs.rs/android_logger/0.11.1/android_logger/struct.FilterBuilder.html

It make possible to construct via builder pattern, plus you can construct filter from RUST_LOG via let filter = android_logger::FilterBuilder::from_env("RUST_LOG").build();

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

1 participant