From 2917e83162bcf07ce33e1ad35943dc4580ab4c95 Mon Sep 17 00:00:00 2001 From: Kenneth Jiang Date: Tue, 3 Sep 2024 20:04:38 -0700 Subject: [PATCH] Lower logging level for some errors that may repeat so that they won't clog the log file by default. --- moonraker_obico/client_conn.py | 6 +++--- moonraker_obico/printer_discovery.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/moonraker_obico/client_conn.py b/moonraker_obico/client_conn.py index 4355d1f..6031db2 100644 --- a/moonraker_obico/client_conn.py +++ b/moonraker_obico/client_conn.py @@ -66,16 +66,16 @@ def send(self, payload): try: self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) except OSError as ex: - _logger.error('could not open udp socket (%s)' % ex) + _logger.warning('could not open udp socket (%s)' % ex) if self.sock is not None: try: self.sock.sendto(payload, (self.addr, self.port)) except socket.error as ex: - _logger.error( + _logger.warning( 'could not send to janus datachannel (%s)' % ex) except OSError as ex: - _logger.error('udp socket might be closed (%s)' % ex) + _logger.warning('udp socket might be closed (%s)' % ex) self.sock = None def close(self): diff --git a/moonraker_obico/printer_discovery.py b/moonraker_obico/printer_discovery.py index 3659e86..909ace4 100644 --- a/moonraker_obico/printer_discovery.py +++ b/moonraker_obico/printer_discovery.py @@ -323,7 +323,7 @@ def _process_unlinked_api_response(self, data): code = msg['data']['code'] verify_link_code(self.config, code) else: - _logger.error('printer_discovery got unexpected message') + _logger.warning('printer_discovery got unexpected message. Dropping it.') self.stop() return