[Zope3-checkins] CVS: Zope3/src/zope/app/services - error.py:1.2 configure.zcml:1.52

Godefroid Chapelle gotcha at swing.be
Tue Aug 12 18:26:32 EDT 2003


Update of /cvs-repository/Zope3/src/zope/app/services
In directory cvs.zope.org:/tmp/cvs-serv4174

Modified Files:
	error.py configure.zcml 
Log Message:
- registered global error reporting service

- it shared its log with root folder error reporting service
so that global errors can be viewed over there



=== Zope3/src/zope/app/services/error.py 1.1 => 1.2 ===
--- Zope3/src/zope/app/services/error.py:1.1	Sun Jun 22 10:01:44 2003
+++ Zope3/src/zope/app/services/error.py	Tue Aug 12 17:26:26 2003
@@ -31,7 +31,6 @@
 import logging
 import time
 
-
 #Restrict the rate at which errors are sent to the Event Log
 _rate_restrict_pool = {}
 
@@ -221,6 +220,20 @@
         return None
     getLogEntryById = ContextMethod(getLogEntryById)
 
+class RootErrorReportingService(ErrorReportingService):
+    rootId = 'root'
+    
+    def _getLog(self):
+        """Returns the log for this object.
+        Careful, the log is shared between threads.
+        """
+        log = _temp_logs.get(self.rootId, None)
+        if log is None:
+            log = []
+            _temp_logs[self.rootId] = log
+        return log
+
+globalErrorReportingService = RootErrorReportingService()
 
 def _cleanup_temp_log():
     _temp_logs.clear()


=== Zope3/src/zope/app/services/configure.zcml 1.51 => 1.52 ===
--- Zope3/src/zope/app/services/configure.zcml:1.51	Thu Aug  7 11:32:41 2003
+++ Zope3/src/zope/app/services/configure.zcml	Tue Aug 12 17:26:26 2003
@@ -386,6 +386,23 @@
         />
     </content>
 
+  <content class='zope.app.services.error.RootErrorReportingService'>
+    <require
+        permission="zope.Public"
+        interface="zope.app.interfaces.services.error.IErrorReportingService"
+        />
+    <require
+        permission="zope.ManageServices"
+        interface="
+          zope.app.interfaces.services.error.ILocalErrorReportingService"
+        />
+    </content>
+
+  <service serviceType="ErrorLogging"
+      permission='zope.Public'        
+      component="zope.app.services.error.globalErrorReportingService" 
+      />
+
 <!-- Object Hub -->
 
   <serviceType
@@ -494,4 +511,4 @@
 <!-- Local Module Support -->
 <include file="module.zcml" />
 
-</configure>
\ No newline at end of file
+</configure>




More information about the Zope3-Checkins mailing list