Open
Description
What's the problem this feature will solve?
My application emits a lot of logs. I'd like to view only a certain channel or channels when I specify e.g. --log-level=debug
in the pytest CLI.
Describe the solution you'd like
It would be nice to be able to specify --log-channel=myapp.a.b
one or more times to display only certain channels. The default could be --log-channel=*
to display everything, but, if a non-default value is given, only the specified channels should be emitted to the console.
This would allow me to filter out log noise from irrelevant channels, especially at the debug level of my application, when trying to debug a specific failing test.
Alternative Solutions
I've not thought of any other solutions. I could add a log handler to my code directly, but that would defeat the purpose of configuring this on-demand via the CLI.