From 56fc179834bfe08589c10f143dfe3cc646746e1e Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Wed, 21 Nov 2018 11:10:45 +0000 Subject: [PATCH] Better logging --- syndicate/mini/core.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/syndicate/mini/core.py b/syndicate/mini/core.py index 0bbc743..fad8e4a 100644 --- a/syndicate/mini/core.py +++ b/syndicate/mini/core.py @@ -168,8 +168,8 @@ class TcpConnection(Connection, asyncio.Protocol): lambda: self, self.host, self.port) - except OSError: - log.error('Could not connect to broker', exc_info=True) + except OSError as e: + log.error('TcpConnection: Could not connect to broker: %s' % (e,)) return False try: @@ -212,8 +212,8 @@ class WebsocketConnection(Connection): self._on_event(protocol.Decoder(chunk).next()) except websockets.exceptions.ConnectionClosed: pass - except OSError: - log.error('Could not connect to broker', exc_info=True) + except OSError as e: + log.error('WebsocketConnection: Could not connect to broker: %s' % (e,)) return False finally: self._on_disconnected()