[Zope-Checkins] CVS: ZODB3/zLOG - datatypes.py:1.10.16.2 EventLogger.py:1.8.6.2

Jeremy Hylton jeremy at zope.com
Mon Sep 15 14:03:27 EDT 2003


Update of /cvs-repository/ZODB3/zLOG
In directory cvs.zope.org:/tmp/cvs-serv13599/zLOG

Modified Files:
      Tag: Zope-2_7-branch
	datatypes.py EventLogger.py 
Log Message:
Take two: Merge changes from ZODB3-3_2-branch to Zope-2_7-branch.

Please make all future changes on the Zope-2_7-branch instead.

The previous attempt used "cvs up -j ZODB3-3_2-branch", but appeared
to get only a small fraction of the changes.  This attempt is based on
copying a checkout of ZODB3-3_2-branch over top of a checkout of
Zope-2_7-branch.


=== ZODB3/zLOG/datatypes.py 1.10.16.1 => 1.10.16.2 ===
--- ZODB3/zLOG/datatypes.py:1.10.16.1	Sat Aug  2 01:48:16 2003
+++ ZODB3/zLOG/datatypes.py	Mon Sep 15 14:02:56 2003
@@ -97,9 +97,6 @@
         logger.setLevel(self.section.level)
         return logger
 
-    def getLevel(self):
-        return self.section.level
-
 class FileHandlerFactory(HandlerFactory):
     def create_loghandler(self):
         from zLOG.LogHandlers import StreamHandler, FileHandler
@@ -227,14 +224,3 @@
             from zLOG.LogHandlers import NullHandler
             logger.addHandler(NullHandler())
         return logger
-
-    def getLowestHandlerLevel(self):
-        """ Return the lowest log level provided by any of our handlers
-        (used by Zope startup logger code to decide what to send
-        to stderr during startup) """
-        lowest = self.level
-        for factory in self.handler_factories:
-            handler_level = factory.getLevel()
-            if handler_level < lowest:
-                lowest = factory.getLevel()
-        return lowest


=== ZODB3/zLOG/EventLogger.py 1.8.6.1 => 1.8.6.2 ===
--- ZODB3/zLOG/EventLogger.py:1.8.6.1	Sat Aug  2 01:35:12 2003
+++ ZODB3/zLOG/EventLogger.py	Mon Sep 15 14:02:56 2003
@@ -44,6 +44,12 @@
         level = (zlog_to_pep282_severity_cache_get(severity) or
                  zlog_to_pep282_severity(severity))
 
+        # Try an early exit if the logger is disabled for this level.
+        # (XXX This inlines logger.isEnabledFor(level).)
+        if (self.logger.manager.disable >= level or
+            level < self.logger.getEffectiveLevel()):
+            return
+
         msg = "%s %s %s" % (
             severity_string_cache_get(severity) or severity_string(severity),
             subsystem,




More information about the Zope-Checkins mailing list