[Zodb-checkins] CVS: Zope3/src/zLOG - EventLogger.py:1.12

Fred L. Drake, Jr. fred at zope.com
Thu Apr 8 16:28:56 EDT 2004


Update of /cvs-repository/Zope3/src/zLOG
In directory cvs.zope.org:/tmp/cvs-serv6590

Modified Files:
	EventLogger.py 
Log Message:
try to be a bit more careful in setting up the event logger; some things should
be done as late as possible (if ever)


=== Zope3/src/zLOG/EventLogger.py 1.11 => 1.12 ===
--- Zope3/src/zLOG/EventLogger.py:1.11	Thu Feb 26 19:31:57 2004
+++ Zope3/src/zLOG/EventLogger.py	Thu Apr  8 16:28:55 2004
@@ -35,9 +35,10 @@
 
     # Get our logger object:
     logger = logging.getLogger('event')
-    # Add a null handler to prevent warnings about loggers with no handlers:
-    logger.addHandler(loghandler.NullHandler())
-    logger.propagate = 0
+    if not logger.handlers:
+        # Add a null handler to prevent warnings about loggers with no
+        # handlers:
+        logger.addHandler(loghandler.NullHandler())
 
     def log(self, subsystem, severity, summary, detail, error):
 
@@ -200,3 +201,5 @@
 
     for handler in handlers:
         event_logger.logger.addHandler(handler)
+
+    event_logger.logger.propagate = 0




More information about the Zodb-checkins mailing list