[Zodb-checkins] CVS: Zope/lib/python/zLOG - datatypes.py:1.14

Fred L. Drake, Jr. fred at zope.com
Wed Dec 31 15:38:42 EST 2003


Update of /cvs-repository/Zope/lib/python/zLOG
In directory cvs.zope.org:/tmp/cvs-serv25580

Modified Files:
	datatypes.py 
Log Message:
move more of the handling of log cycling into zLOG, allowing
applications to know less about how this is implemented


=== Zope/lib/python/zLOG/datatypes.py 1.13 => 1.14 ===
--- Zope/lib/python/zLOG/datatypes.py:1.13	Thu Nov  6 02:59:12 2003
+++ Zope/lib/python/zLOG/datatypes.py	Wed Dec 31 15:38:41 2003
@@ -16,6 +16,9 @@
 
 import sys
 
+import zLOG
+
+from zLOG import EventLogger
 from zLOG.factory import Factory
 
 # log-related datatypes
@@ -238,6 +241,18 @@
             if handler_level < lowest:
                 lowest = factory.getLevel()
         return lowest
+
+    def initialize(self):
+        logger = self()
+        for handler in logger.handlers:
+            if hasattr(handler, "reopen"):
+                handler.reopen()
+        EventLogger.event_logger.logger = self()
+
+    def startup(self):
+        zLOG.set_initializer(self.initialize)
+        zLOG.initialize()
+
 
 def importable_name(name):
     try:




More information about the Zodb-checkins mailing list