try:
super().handle_msg(msg)
except ImplementationFail as e:
- self._log(str(e), scope=LogScope.DEBUG, alert=True)
+ self._log(str(e), alert=True)
def _log(self, msg: str, scope: Optional[LogScope] = None, **kwargs
) -> None:
- to_log = []
- if msg:
- to_log += [msg]
if not scope:
scope = LogScope.DEBUG
- for item in to_log:
- self._client_tui_trigger('log', scope=scope, msg=item, **kwargs)
- if scope == LogScope.RAW:
- with open(f'{self.client_id}.log', 'a', encoding='utf8') as f:
- f.write(('>' if kwargs['out'] else '<') + f' {msg}\n')
+ self._client_tui_trigger('log', scope=scope, msg=msg, **kwargs)
+ if scope == LogScope.RAW:
+ with open(f'{self.client_id}.log', 'a', encoding='utf8') as f:
+ f.write(('>' if kwargs['out'] else '<') + f' {msg}\n')
def _on_update(self, *path) -> None:
for path, value in self.db.into_endnode_updates(path):