Permalink
Browse files

Logging tweak.

Strip NULL from the protocol stuff so that the log files are better
behaved (i.e. detected as text files by programs like grep).

Signed-off-by: Jack Miller <jack@codezen.org>
  • Loading branch information...
1 parent 8c9d6af commit bf67eac737fc98ef3b5b5bfc781f8eb038a020ea @themoken committed May 11, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 canto_next/protocol.py
@@ -198,7 +198,7 @@ def _do_read(self, conn, timeout):
log.debug("Read POLLIN with no data")
return select.POLLHUP
- log.debug("Read Buffer: %s" % fragment )
+ log.debug("Read Buffer: %s" % fragment.replace("\0",""))
return self.parse(conn, fragment)
# Parse POLLHUP last so if we still got POLLIN, any data
@@ -235,7 +235,7 @@ def _do_write(self, conn, cmd, args):
log.error("Interpreting as HUP")
return select.POLLHUP
- log.debug("Sending: %s" % tosend)
+ log.debug("Sending: %s" % tosend.replace("\0",""))
eintr_count = 0
while tosend:

0 comments on commit bf67eac

Please sign in to comment.