I suggest adding a new method env_filter::filter::try_parse(&mut self, filters: &str) -> Result<&mut Self, ParsingError>. This would imply adding a new ParsingError type and a small refactoring, but would make the library more convenient in some situations.
In my use case, I don't have access to the contents of stderr when the application is starting, and I actually don't want the application to start if the logger is configured incorrectly. Such a method would let me do this without copying the parser implementation to the application code.
If the maintainers agree that this can be added to the env_logger, I am happy to create a PR.
I suggest adding a new method
env_filter::filter::try_parse(&mut self, filters: &str) -> Result<&mut Self, ParsingError>
. This would imply adding a newParsingError
type and a small refactoring, but would make the library more convenient in some situations.In my use case, I don't have access to the contents of
stderr
when the application is starting, and I actually don't want the application to start if the logger is configured incorrectly. Such a method would let me do this without copying the parser implementation to the application code.If the maintainers agree that this can be added to the
env_logger
, I am happy to create a PR.