Skip to content

Commit

Permalink
Lower logging level for some errors that may repeat so that they won'…
Browse files Browse the repository at this point in the history
…t clog the log file by default.
  • Loading branch information
kennethjiang committed Sep 4, 2024
1 parent 0671467 commit 2917e83
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions moonraker_obico/client_conn.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion moonraker_obico/printer_discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2917e83

Please sign in to comment.