[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/ZopePublication - ZopePublication.py:1.15

Guido van Rossum guido@python.org
Thu, 19 Dec 2002 17:54:57 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/App/ZopePublication
In directory cvs.zope.org:/tmp/cvs-serv14903

Modified Files:
	ZopePublication.py 
Log Message:
Convert to logging module.


=== Zope3/lib/python/Zope/App/ZopePublication/ZopePublication.py 1.14 => 1.15 ===
--- Zope3/lib/python/Zope/App/ZopePublication/ZopePublication.py:1.14	Thu Dec 19 14:43:43 2002
+++ Zope3/lib/python/Zope/App/ZopePublication/ZopePublication.py	Thu Dec 19 17:54:57 2002
@@ -12,7 +12,7 @@
 # 
 ##############################################################################
 import sys
-from zLOG import LOG, ERROR, INFO
+import logging
 
 from Zope.ComponentArchitecture import getService
 from Zope.ComponentArchitecture.Exceptions import ComponentLookupError
@@ -187,10 +187,9 @@
                 # the ErrorReportingService, and that it will be in
                 # the zope log.
                 except:
-                    LOG('SiteError', ERROR,
+                    logging.getLogger('SiteError').exception(
                         'Error while reporting an error to the '
-                        'ErrorReportingService', 
-                        error=sys.exc_info())
+                        'ErrorReportingService')
 
             # Delegate Unauthorized errors to the authentication service
             # XXX Is this the right way to handle Unauthorized?  We need
@@ -217,10 +216,10 @@
 
             # Convert ConflictErrors to Retry exceptions.
             if retry_allowed and isinstance(exc_info[1], ConflictError):
-                LOG('Zope Publication', INFO,
-                    'Competing writes/reads at %s'
-                    % request.get('PATH_INFO', '???'),
-                    error=sys.exc_info())
+                logger.getLogger('ZopePublication').warn(
+                    'Competing writes/reads at %s',
+                    request.get('PATH_INFO', '???'),
+                    exc_info=True)
                 raise Retry
 
             # Let the response handle it as best it can.