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

2008-04-10 Thread Thomas Dimson
On Apr 10, 3:05 pm, svensven <[EMAIL PROTECTED]> wrote: > Vinay Sajip wrote: > >  > On Apr 10, 1:11 pm, "sven _" <[EMAIL PROTECTED]> wrote: >  >> My goal is to have stdout and stderr written to a logginghandler. >  > >  > Thomas was almost right, but not quite - you can't call info on a >  > Handle

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

2008-04-10 Thread svensven
Vinay Sajip wrote: > On Apr 10, 1:11 pm, "sven _" <[EMAIL PROTECTED]> wrote: >> My goal is to have stdout and stderr written to a logginghandler. > > Thomas was almost right, but not quite - you can't call info on a > Handler instance, only on a Logger instance. The following script: Yes, but

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

2008-04-10 Thread svensven
Thomas Dimson wrote: > On Apr 10, 8:11 am, "sven _" <[EMAIL PROTECTED]> wrote: >> My goal is to have stdout and stderr written to a logging handler. >> This code does not work: >> >> # START >> import logging, subprocess >> ch = logging.StreamHandler() >> ch.setLevel(logging.DEBUG) >> subp

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

2008-04-10 Thread Vinay Sajip
On Apr 10, 1:11 pm, "sven _" <[EMAIL PROTECTED]> wrote: > Version: Python 2.5.1 (r251:54863, Mar 7 2008, 04:10:12) > > My goal is to have stdout and stderr written to alogginghandler. > This code does not work: > > # START > importlogging, subprocess > ch =logging.StreamHandler() > ch.setLevel(log

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

2008-04-10 Thread Gerard Flanagan
On Apr 10, 5:34 pm, Gerard Flanagan <[EMAIL PROTECTED]> wrote: > On Apr 10, 2:11 pm, "sven _" <[EMAIL PROTECTED]> 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: > [...]

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

2008-04-10 Thread Gerard Flanagan
On Apr 10, 2:11 pm, "sven _" <[EMAIL PROTECTED]> 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: > > # START > import logging, subprocess > ch = logging.StreamHandler() > ch.setLevel

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

2008-04-10 Thread Thomas Dimson
On Apr 10, 8:11 am, "sven _" <[EMAIL PROTECTED]> 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: > > # START > import logging, subprocess > ch = logging.StreamHandler() > ch.setLevel

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

2008-04-10 Thread sven _
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: # START import logging, subprocess ch = logging.StreamHandler() ch.setLevel(logging.DEBUG) subprocess.call(['ls', '-la'], 0, None, None, ch, ch) #