self._log = log
super().__init__(**kwargs)
self._title = f'{self.client_id} '\
- + f':{"SERVER" if self.scope == LogScope.SERVER else "RAW"}'
+ + f':{"DEBUG" if self.scope == LogScope.DEBUG else "RAW"}'
def _send_msg(self, verb: str, params: tuple[str, ...]) -> None:
self._client_trigger('send_w_params_tuple', verb=verb, params=params)
def cmd__disconnect(self, quit_msg: str = 'ircplom says bye') -> None:
'Send QUIT command to server.'
- self._log('requesting disconnect …', scope=LogScope.SERVER)
+ self._log('requesting disconnect …', scope=LogScope.DEBUG)
self._send_msg('QUIT', (quit_msg,))
def cmd__reconnect(self) -> None:
self._set(update.key, update.value)
do_report |= True
if do_report:
- update.results += [(LogScope.SERVER,
+ update.results += [(LogScope.DEBUG,
tuple(sorted(update.value))
if isinstance(update.value, set)
else update.value)]
self._tui_new_window = tui_new_window
self.db = _TuiClientDb()
self.windows: list[_ClientWindow] = []
- for scope in (LogScope.SERVER, LogScope.RAW):
+ for scope in (LogScope.DEBUG, LogScope.RAW):
self._new_win(scope)
def _new_win(self, scope: LogScope, chatname: str = '') -> _ClientWindow:
'From parsing scope, kwargs, build prefix before sending to logger.'
first_char = '$'
sender_label = ''
- if 'out' in kwargs and scope != LogScope.SERVER:
+ if 'out' in kwargs and scope != LogScope.DEBUG:
first_char = _LOG_PREFIX_OUT if kwargs['out'] else _LOG_PREFIX_IN
if scope == LogScope.CHAT:
sender_label = (
m = self._client_mngrs[kwargs['client_id']]
if scope == LogScope.ALL:
return [w for w in m.windows
- if w.scope not in {LogScope.SERVER, LogScope.RAW}]
- if scope == LogScope.SERVER:
- return [m.window(LogScope.SERVER), m.window(LogScope.RAW)]
+ if w.scope not in {LogScope.DEBUG, LogScope.RAW}]
+ if scope == LogScope.DEBUG:
+ return [m.window(LogScope.DEBUG), m.window(LogScope.RAW)]
if scope == LogScope.CHAT:
chatname = (kwargs['target']
if kwargs['target'] != m.db.users['me'].nick
if msg:
to_log += [msg]
if not scope:
- scope = LogScope.SERVER
+ scope = LogScope.DEBUG
for item in to_log:
self._client_tui_trigger('log', scope=scope, msg=item, **kwargs)
if scope == LogScope.RAW: