[Zodb-checkins] CVS: Packages/zLOG - EventLogger.py:1.8.6.4

Andreas Jung andreas at andreas-jung.com
Mon Aug 2 07:48:34 EDT 2004


Update of /cvs-repository/Packages/zLOG
In directory cvs.zope.org:/tmp/cvs-serv4004

Modified Files:
      Tag: Zope-2_7-branch
	EventLogger.py 
Log Message:
Collector #1234: an exception triple passed to LOG() was not propagated properly to
the logging module of Python


=== Packages/zLOG/EventLogger.py 1.8.6.3 => 1.8.6.4 ===
--- Packages/zLOG/EventLogger.py:1.8.6.3	Fri Sep 19 17:16:49 2003
+++ Packages/zLOG/EventLogger.py	Mon Aug  2 07:48:33 2004
@@ -52,6 +52,16 @@
         if detail:
             msg = "%s\n%s" % (msg, detail)
 
+        # Since the logging module of Python does not allow to pass a
+        # traceback triple, we need to fake the exception. (See also
+        # Collector #1234).
+
+        if isinstance(error, tuple):
+            try:
+                raise error[0], error[1], error[2]
+            except:
+                pass
+
         self.logger.log(level, msg, exc_info=(error is not None))
 
 event_logger = EventLogger()



More information about the Zodb-checkins mailing list