Making `logging.basicConfig` log to *both* `sys.stderr` and `sys.stdout`?

Peter Otten __peter__ at web.de
Tue Aug 30 05:45:53 EDT 2011


Michel Albert wrote:

> I use python oftentimes to write automation scripts on Linux servers.
> And there's a big pattern in my scripts:
> 
> - I *always* use `logging` instead of `print` statements.
> - I *always* create two stream handlers. One for `sys.stdout` with
> level `INFO` and one for `sys.stderr` with level `WARN`
> 
> Well, the levels may variate occasionally, but that's only the rare
> exception.

How would a call to basicConfig() look like that produces this setup?




More information about the Python-list mailing list