Re: Logging
From: Neil Benn (benn_at_cenix-bioscience.com)
Date: 02/03/05
- Next message: John Machin: "Re: Crashing Python interpreter! (windows XP, python2.3.4, 2.3.5rc1, 2.4.0)"
- Previous message: alexrait1: "pyGTK warning"
- In reply to: Samuel Kilchenmann: "Re: Logging"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 03 Feb 2005 11:56:21 +0100
Samuel Kilchenmann wrote:
> "<snip>
>
> .>>> logging._handlers.clear()
> .>>> logging.root.handlers = []
> .>>> for l in logging.Logger.manager.loggerDict.values():
> .>>> l.handlers = []
> after logging.shutdown() and before getting the new logger, your
> script will probably run without errors.
<snip>
Hello,
Yeah, I worked that out after a bit, I solved it by keeping a
record of all the handlers and then calling flush on the handler
followed by removeHandler from the logger. It's a bit of a pain but I'd
prefer to do that rather than go poking around inside the logging
package but I will put the cleaning up of the dict on a shutdown() call
as a feature request for logging.
Thanks for the comm.
Cheers,
Neil
-- Neil Benn Senior Automation Engineer Cenix BioScience BioInnovations Zentrum Tatzberg 46 D-01307 Dresden Germany Tel : +49 (0)351 4173 154 e-mail : benn@cenix-bioscience.com Cenix Website : http://www.cenix-bioscience.com
- Next message: John Machin: "Re: Crashing Python interpreter! (windows XP, python2.3.4, 2.3.5rc1, 2.4.0)"
- Previous message: alexrait1: "pyGTK warning"
- In reply to: Samuel Kilchenmann: "Re: Logging"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|