From 769ece2514b81cf1f47c37ea12b3b24741bff86a Mon Sep 17 00:00:00 2001 From: David Wilson Date: Thu, 21 Sep 2017 15:56:29 +0530 Subject: [PATCH] fakessh: improve logging slightly. Makes it easier to match up reads/writes across log files by using message byte count --- mitogen/fakessh.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/mitogen/fakessh.py b/mitogen/fakessh.py index 7d0a6419..c1b2b7c9 100644 --- a/mitogen/fakessh.py +++ b/mitogen/fakessh.py @@ -163,12 +163,13 @@ class Process(object): return data = msg.unpickle() - IOLOG.debug('%r._on_stdin(%r)', self, data) - if data == mitogen.core._DEAD: + IOLOG.debug('%r._on_stdin() -> %r', self, data) self.pump.close() - else: - self.pump.write(data) + return + + IOLOG.debug('%r._on_stdin() -> len %d', self, len(data)) + self.pump.write(data) def _on_control(self, msg): if msg != mitogen.core._DEAD: @@ -195,7 +196,7 @@ class Process(object): self.router.broker.shutdown() def _on_pump_receive(self, s): - IOLOG.info('%r._on_pump_receive()', self) + IOLOG.info('%r._on_pump_receive(len %d)', self, len(s)) self.stdin.put(s) def _on_pump_disconnect(self):