subprocess.Popen() output to logging.StreamHandler()

Gerard Flanagan grflanagan at gmail.com
Thu Apr 10 11:54:50 EDT 2008


On Apr 10, 5:34 pm, Gerard Flanagan <grflana... at gmail.com> wrote:
> On Apr 10, 2:11 pm, "sven _" <svens... at gmail.com> wrote:
>
>
>
> > Version: Python 2.5.1 (r251:54863, Mar  7 2008, 04:10:12)
>
> > My goal is to have stdout and stderr written to a logging handler.
> > This code does not work:
>
[...]
> > Are there better solutions?
>
> > sven
>
> When you create a StreamHandler, it is associated with a particular
> stream, eg. sys.stdout.  So when you log an event, the handler picks
> it up and writes it to the stream.  But you seem to think that...

[snip didacticism]

Rereading your post, I think I've just told you what you already
knew...

Never mind.

G.



More information about the Python-list mailing list