Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an attempt to make
env_logger
s filtering more of a first-class API that people can use to build their own loggers.I think @jethrogb's solution is actually super clever and required basically no extra code to make it work. I never would've thought to do that. But I feel like we could make filtering even more first-class at the expense of some more code to maintain. Having a
Target::Silent
seems a little odd, because you would never want to actually install an empty logger as the default, and is a bit of a roundabout way to get at the filtering.There's still some cleanup and docs to do here, but I thought I'd open it up and see what people think. From the user's point of view the code looks basically the same, but I think the intent is a bit clearer when you're building your own logger, which is an important cop-out to supporting targets like files in
env_logger
.r? @jethrogb