[Python-Dev] Redirecting stdout/stderr to the logging module (was Re: Using logging in the stdlib and its unit tests) (original) (raw)
Antoine Pitrou solipsis at pitrou.net
Wed Dec 8 19🔞07 CET 2010
- Previous message: [Python-Dev] Redirecting stdout/stderr to the logging module (was Re: Using logging in the stdlib and its unit tests)
- Next message: [Python-Dev] Redirecting stdout/stderr to the logging module (was Re: Using logging in the stdlib and its unit tests)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Thu, 9 Dec 2010 03:28:36 +1000 Nick Coghlan <ncoghlan at gmail.com> wrote:
On Thu, Dec 9, 2010 at 2:46 AM, Vinay Sajip <vinaysajip at yahoo.co.uk> wrote: > Nick Coghlan <ncoghlan gmail.com> writes: >> P.S. On a completely unrelated note, has anyone thought about creating >> a write-only TextIO stream that outputs received writes via the >> logging module? >> > > Is this for use at the C level? At the Python level, there's a post I wrote a > while back which shows how to use a logger like an output stream: > > http://plumberjack.blogspot.com/2009/09/how-to-treat-logger-like-output-stream.html
Similar in concept, but more full-featured (i.e. supporting the relevant IO ABCs), allowing it to be used as a replacement for stdout/stderr.
That would be an interesting idea. It would fit in the logging module rather than the io module IMO. However, there are some limitations due to the fact that logging is line-based while people may output arbitrary text on stderr (perhaps ASCII-formatted tables, who knows).
Regards
Antoine.
- Previous message: [Python-Dev] Redirecting stdout/stderr to the logging module (was Re: Using logging in the stdlib and its unit tests)
- Next message: [Python-Dev] Redirecting stdout/stderr to the logging module (was Re: Using logging in the stdlib and its unit tests)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]