[Zodb-checkins] CVS: Zope/lib/python/zLOG - AccessLogger.py:1.1.2.4

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


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

Modified Files:
      Tag: chrism-install-branch
	AccessLogger.py 
Log Message:
Make this logger more similar to the DebugLogger.


=== Zope/lib/python/zLOG/AccessLogger.py 1.1.2.3 => 1.1.2.4 ===
--- Zope/lib/python/zLOG/AccessLogger.py:1.1.2.3	Fri Jan  3 01:47:00 2003
+++ Zope/lib/python/zLOG/AccessLogger.py	Tue Jan 28 11:44:23 2003
@@ -16,16 +16,23 @@
 
 This depends on Vinay Sajip's PEP 282 logging module.
 """
+
 import logging
-from BaseLogger import BaseLogger
+
+from zLOG.BaseLogger import BaseLogger
+
 
 class AccessLogger(BaseLogger):
+
     logger = logging.getLogger('access')
+
     def log(self, message):
-        if not self.logger.handlers: # dont log if we have no handlers
+        if not self.logger.handlers:
+            # don't log if there are no handlers
             return
-        if message.endswith('\n'):
-            message = message[:-1]
-        self.logger.warn(message)
+        self.logger.warn(message.rstrip())
+
 
 access_logger = AccessLogger()
+log = access_logger.log
+reopen = access_logger.reopen