[Zodb-checkins] CVS: Zope/lib/python/zLOG - DebugLogger.py:1.1.2.5

Fred L. Drake, Jr. fred@zope.com
Tue, 28 Jan 2003 11:32:54 -0500


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

Modified Files:
      Tag: chrism-install-branch
	DebugLogger.py 
Log Message:
- minor cleanup
- remove second parameter from time.strftime() call; avoids extra
  calls in this code, making it faster, but causing it to require
  Python 2.2 (already required for Zope 2.7)


=== Zope/lib/python/zLOG/DebugLogger.py 1.1.2.4 => 1.1.2.5 ===
--- Zope/lib/python/zLOG/DebugLogger.py:1.1.2.4	Fri Jan  3 01:47:00 2003
+++ Zope/lib/python/zLOG/DebugLogger.py	Tue Jan 28 11:32:48 2003
@@ -35,20 +35,23 @@
 
 import time
 import logging
-from BaseLogger import BaseLogger
+
+from zLOG.BaseLogger import BaseLogger
+
 
 class DebugLogger(BaseLogger):
+
     logger = logging.getLogger('trace')
+
     def log(self, code, request_id, data=''):
         if not self.logger.handlers:
             return
-        t=time.strftime('%Y-%m-%dT%H:%M:%S', time.localtime(time.time()))
+        # Omitting the second parameter requires Python 2.2 or newer.
+        t = time.strftime('%Y-%m-%dT%H:%M:%S')
         message = '%s %s %s %s' % (code, request_id, t, data)
         self.logger.warn(message)
 
-#DebugLogger.log('U', '000000000', 'System startup')
 
 debug_logger = DebugLogger()
 log = debug_logger.log
 reopen = debug_logger.reopen
-