From 85411a9bac46613dd7733ab22218c45149ae1dda Mon Sep 17 00:00:00 2001 From: Erik Date: Fri, 16 Nov 2018 15:44:47 +0100 Subject: [PATCH] Decrease log level to debug for PING/PONG --- rflinkproxy/__main__.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/rflinkproxy/__main__.py b/rflinkproxy/__main__.py index cb3f463..84ec6c2 100644 --- a/rflinkproxy/__main__.py +++ b/rflinkproxy/__main__.py @@ -141,7 +141,10 @@ def handle_raw_tx_packet(self, writer, raw_packet): log.debug(' %s:%s: decoded packet: %s', peer[0], peer[1], packet) if self.protocol and packet: - log.info(' %s:%s: forwarding packet %s to RFLink', peer[0], peer[1], raw_packet) + if not ';PING;' in raw_packet: + log.info(' %s:%s: forwarding packet %s to RFLink', peer[0], peer[1], raw_packet) + else: + log.debug(' %s:%s: forwarding packet %s to RFLink', peer[0], peer[1], raw_packet) yield from self.forward_packet(writer, packet, raw_packet) else: log.warning(' %s:%s: no valid packet %s', peer[0], peer[1], packet) @@ -200,7 +203,10 @@ def client_connected_callback(self, reader, writer): def raw_callback(self, raw_packet): """Send data to all connected clients.""" - log.info('forwarding packet %s to clients', raw_packet) + if not ';PONG;' in raw_packet: + log.info('forwarding packet %s to clients', raw_packet) + else: + log.debug('forwarding packet %s to clients', raw_packet) writers = [i[1] for i in list(clients)] for writer in writers: writer.write(str(raw_packet).encode() + CRLF)