[CalendarServer-changes] [4682] CalendarServer/branches/more-deferreds-4/twistedcaldav/log.py

source_changes at macosforge.org source_changes at macosforge.org
Fri Oct 30 11:28:53 PDT 2009


Revision: 4682
          http://trac.macosforge.org/projects/calendarserver/changeset/4682
Author:   glyph at apple.com
Date:     2009-10-30 11:28:49 -0700 (Fri, 30 Oct 2009)
Log Message:
-----------
Give the correct signature to the 'err' Twisted logging compatibility handler.

Modified Paths:
--------------
    CalendarServer/branches/more-deferreds-4/twistedcaldav/log.py

Modified: CalendarServer/branches/more-deferreds-4/twistedcaldav/log.py
===================================================================
--- CalendarServer/branches/more-deferreds-4/twistedcaldav/log.py	2009-10-30 18:19:24 UTC (rev 4681)
+++ CalendarServer/branches/more-deferreds-4/twistedcaldav/log.py	2009-10-30 18:28:49 UTC (rev 4682)
@@ -59,7 +59,7 @@
 import inspect
 import logging
 
-from twisted.python import log
+from twisted.python import log, failure
 
 from StringIO import StringIO
 
@@ -321,6 +321,14 @@
             d.addCallback(_gotData)
             return d
 
+    def err(self, _stuff=None, _why=None, **kw):
+        """
+        Compatibility layer for Twisted's log module.
+        """
+        self.emit("error", _why or "Unhandled Error",
+              isError=1, failure=_stuff or failure.Failure(),
+              **kw)
+
 class LoggingMixIn (object):
     """
     Mix-in class for logging methods.
@@ -388,7 +396,6 @@
 
 # Add some compatibility with twisted's log module
 Logger.msg = Logger.info
-Logger.err = Logger.error
 
 ##
 # Errors
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20091030/66312df0/attachment-0001.html>


More information about the calendarserver-changes mailing list