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
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
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 tw
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 thi
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.
Here are the stacktraces I created for debugging this:
===> python manage.py test admin
import logconfig
Traceback (most rec
5 matches
Mail list logo