Only initize logger once
authorW. Trevor King <wking@drexel.edu>
Thu, 1 Jul 2010 04:18:51 +0000 (00:18 -0400)
committerW. Trevor King <wking@drexel.edu>
Thu, 1 Jul 2010 04:18:51 +0000 (00:18 -0400)
sitecore/__init__.py

index 90a38920f97da6ceb2e576a0b689c251594d2bd2..63fc6a2b5252bd9f67f8dbf8090754a327284fcf 100755 (executable)
@@ -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