From c1364f85a7a163025acf836ea55e14549a5af339 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 1 Jul 2010 00:18:51 -0400 Subject: [PATCH] Only initize logger once --- sitecore/__init__.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sitecore/__init__.py b/sitecore/__init__.py index 90a3892..63fc6a2 100755 --- a/sitecore/__init__.py +++ b/sitecore/__init__.py @@ -37,7 +37,13 @@ try: except ImportError, e: WebDriver = e # allow some functionality without selenium + +_LOGGER = None + def get_logger(verbose=0): + global _LOGGER + if _LOGGER != None: + return LOGGER verbosities = [ # in order of decreasing severity logging.CRITICAL, logging.ERROR, @@ -59,6 +65,7 @@ def get_logger(verbose=0): ch.setFormatter(formatter) # add ch to logger logger.addHandler(ch) + _LOGGER = logger return logger -- 2.26.2