Help with logging module

Kenneth Pronovici pronovic at skyjammer.com
Mon May 19 00:21:26 EDT 2003


>     applog.setLevel(logging.INFO)
>     stdouthandler.setLevel(logging.INFO)
>     stderrhandler.setLevel(logging.ERROR)
> 
>     applog.error('error') # appears on stdout and stderr
>     applog.info('info')   # appears only on stdout
>     applog.debug('debug') # appears neither on stdout nor on stderr
> 
> > I'm sure this can be done, but I'm not sure what I'm missing.  Can
> > someone point out where I've gone wrong here?  
> 
> It's hard to say, without seeing some code that doesn't do what
> you expect.

Sorry that I didn't provide example code.

In terms of your example, what I didn't do was applog.setLevel() - I
only called setLevel() for the handlers.  I think that explains my
problem.  As I look at this, it's fairly obvious - I should have tried
it before asking here.

Thanks for the help.

KEN

-- 
Kenneth J. Pronovici <pronovic at ieee.org>
Personal Homepage: http://www.skyjammer.com/~pronovic/
"They that can give up essential liberty to obtain a little 
 temporary safety deserve neither liberty nor safety." 
      - Benjamin Franklin, Historical Review of Pennsylvania, 1759 




More information about the Python-list mailing list