[CalendarServer-changes] [8770] CalendarServer/trunk/twistedcaldav/mail.py

source_changes at macosforge.org source_changes at macosforge.org
Tue Feb 28 16:12:03 PST 2012


Revision: 8770
          http://trac.macosforge.org/projects/calendarserver/changeset/8770
Author:   wsanchez at apple.com
Date:     2012-02-28 16:12:03 -0800 (Tue, 28 Feb 2012)
Log Message:
-----------
Make imap4.py shut up about unhandled unsolicited responses

Modified Paths:
--------------
    CalendarServer/trunk/twistedcaldav/mail.py

Modified: CalendarServer/trunk/twistedcaldav/mail.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/mail.py	2012-02-28 22:55:07 UTC (rev 8769)
+++ CalendarServer/trunk/twistedcaldav/mail.py	2012-02-29 00:12:03 UTC (rev 8770)
@@ -92,6 +92,17 @@
 log = Logger()
 
 #
+# Monkey patch imap4.log so it doesn't emit useless logging,
+# specifically, "Unhandled unsolicited response" nonsense.
+#
+class IMAPLogger(Logger):
+    def emit(self, level, message, *args, **kwargs):
+        if not message.startswith("Unhandled unsolicited response: "):
+            super(Logger, self).emit(level, message, *args, **kwargs)
+
+imap4.log = IMAPLogger()
+
+#
 # Templates
 #
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20120228/9a4cf4f2/attachment.html>


More information about the calendarserver-changes mailing list