logging module question

chuck cmedcoff at gmail.com
Mon Jan 23 23:33:58 CET 2006


Ok, so I've figured this out (see below),

    mail = logging.handlers.SMTPHandler('mail.vw.com',
                                       'charles.medcoff at gedas.com',
                                       'charles.medcoff at gedas.com',
                                       'Data Processing Error at
location: %s' % "Chuck's Desk")
    mail.setFormatter(logging.Formatter('%(asctime)s %(message)s'))
    ml = logging.getLogger('mail')
    ml.addHandler(mail)
    ml.propagate = 0  ## <---------------do this to turn off
propagation of error reporting

but now I'd like to understand the design rational behind having each
logger in the object hierarchy log the same output by default.  Anyone?




More information about the Python-list mailing list