Loggers and reloads

François Bouffard newsREMOVE at THISfb.wwd.ca
Thu May 27 00:22:01 EDT 2004


> I bet it
> would also be possible to check if for a given logger already a handler is
> registered, and refuse to add another one.

You're completely right, thank you. There's always only one logger 
object in my code, however, each time the module is reloaded, a new 
handler is added. Therefore, something like:

for h in logger.handlers:
	logger.removeHandler(h)

indeed does the trick if I put it before the logger.addHandler() call.

Thanks again.



More information about the Python-list mailing list