[tor-commits] [bridgedb/master] Add extra logging to b.e.server.MailResponse methods.

isis at torproject.org isis at torproject.org
Fri Jun 6 23:39:14 UTC 2014


commit e34c3f21d723ab1a9dea8b9fffa7ee2032a86614
Author: Isis Lovecruft <isis at torproject.org>
Date:   Thu May 29 19:59:50 2014 +0000

    Add extra logging to b.e.server.MailResponse methods.
---
 lib/bridgedb/email/server.py |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/bridgedb/email/server.py b/lib/bridgedb/email/server.py
index f2258a6..7904c36 100644
--- a/lib/bridgedb/email/server.py
+++ b/lib/bridgedb/email/server.py
@@ -332,13 +332,15 @@ class MailResponse(object):
 
     def rewind(self):
         """Rewind to the very beginning of the :cvar:`mailfile`."""
+        logging.debug("Rewinding %s.mailfile..." % self.__class__.__name__)
         self.mailfile.seek(0)
 
     def write(self, line):
         """Any **line** written to me will have ``'\r\n'`` appended to it."""
         if line.find('\n') != -1:
             # If **line** contains newlines, send it to :meth:`writelines` to
-            # break it up so that we can replace them with '\r\n':
+            # break it up so that we can replace them:
+            logging.debug("Found newlines in %r. Calling writelines()." % line)
             self.writelines(line)
         else:
             self.mailfile.write(self._buff(line + '\r\n'))
@@ -406,7 +408,9 @@ class MailResponse(object):
 
         :param str body: The body of the response email.
         """
+        logging.info("Writing email body...")
         if self.gpgContext:
+            logging.info("Attempting to sign email...")
             body, _ = gpgSignMessage(self.gpgContext, body)
         self.writelines(body)
 





More information about the tor-commits mailing list