Am Dienstag, 6. November 2007 07:00 schrieb Matti Haavikko:
> Here's an alternative solution - it's based on the idea that the
> handlers are added to the logger only once. (getLogger returns the same
> logger instance each time).
>
> import logging
> logger=logging.getLogger("dws")
> if not logge
Thomas Guettler wrote:
> A found this solution.
>
> # file logconfig.py
> import logging
> if not hasattr(logging, "set_up_done"):
> logging.set_up_done=False
>
> def set_up(myhome):
> if logging.set_up_done:
> return
> logging.set_up_done=True
>
Here's an alternative soluti
Am Montag, 5. November 2007 10:55 schrieb Malcolm Tredinnick:
> On Mon, 2007-11-05 at 10:46 +0100, Thomas Güttler wrote:
> > Hi,
> >
> > settings.py gets imported twice. This is bad, if you want to
> > set up the logging module, since you register the handler twice
> > and you get all log messages
On Mon, 2007-11-05 at 10:46 +0100, Thomas Güttler wrote:
> Hi,
>
> settings.py gets imported twice. This is bad, if you want to
> set up the logging module, since you register the handler twice
> and you get all log messages twice.
[...]
It's actually fairly hard to avoid this for a variety of r
4 matches
Mail list logo