improvements on interactive client

- add selective logging
- fix handling of exceptions

Change-Id: I7e2c2d4ed12302874c3bb2cc7bd707aa8e487341
This commit is contained in:
2022-09-14 13:59:51 +02:00
parent b0315e133b
commit aad1c33742
2 changed files with 33 additions and 6 deletions

View File

@ -356,7 +356,7 @@ class SecopClient(ProxyClient):
except ConnectionClosed:
pass
except Exception as e:
self.log.error('rxthread ended with %s' % e)
self.log.error('rxthread ended with %r', e)
self._rxthread = None
self.disconnect(False)
if self._shutdown:
@ -490,7 +490,7 @@ class SecopClient(ProxyClient):
def _unhandled_message(self, action, ident, data):
if not self.callback(None, 'unhandledMessage', action, ident, data):
self.log.warning('unhandled message: %s %s %r' % (action, ident, data))
self.log.warning('unhandled message: %s %s %r', action, ident, data)
def _set_state(self, online, state=None):
# remark: reconnecting is treated as online