Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #12433

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

From Peter Otten <__peter__@web.de>
Newsgroups comp.lang.python
Subject Re: Making `logging.basicConfig` log to *both* `sys.stderr` and `sys.stdout`?
Followup-To comp.lang.python
Date 2011-08-30 11:45 +0200
Organization None
Message-ID <j3ibfq$mtm$1@solani.org> (permalink)
References <7f46ab8f-710c-4463-a072-fa80c49f90de@ea4g2000vbb.googlegroups.com>

Followups directed to: comp.lang.python

Show all headers | View raw


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?

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Making `logging.basicConfig` log to *both* `sys.stderr` and `sys.stdout`? Michel Albert <exhuma@gmail.com> - 2011-08-30 01:53 -0700
  Re: Making `logging.basicConfig` log to *both* `sys.stderr` and `sys.stdout`? Peter Otten <__peter__@web.de> - 2011-08-30 11:45 +0200
    Re: Making `logging.basicConfig` log to *both* `sys.stderr` and `sys.stdout`? Michel Albert <exhuma@gmail.com> - 2011-08-30 04:59 -0700
  Re: Making `logging.basicConfig` log to *both* `sys.stderr` and `sys.stdout`? Vinay Sajip <vinay_sajip@yahoo.co.uk> - 2011-09-02 15:59 -0700

csiph-web