Browse Source

More debug logging on IRCClient

master
JustAnotherArchivist 3 years ago
parent
commit
efbb360e48
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      irclog.py

+ 4
- 0
irclog.py View File

@@ -577,11 +577,15 @@ class IRCClient:
while True:
connectionClosedEvent.clear()
try:
self.logger.debug('Creating IRC connection')
self._transport, self._protocol = await loop.create_connection(lambda: IRCClientProtocol(self.messageQueue, connectionClosedEvent, loop, self.config, self.channels), self.config['irc']['host'], self.config['irc']['port'], ssl = self._get_ssl_context())
self.logger.debug('Waiting for connection closure or SIGINT')
try:
await asyncio.wait((connectionClosedEvent.wait(), sigintEvent.wait()), return_when = asyncio.FIRST_COMPLETED)
finally:
self.logger.debug(f'Got connection closed {connectionClosedEvent.is_set()} / SIGINT {sigintEvent.is_set()}')
if not connectionClosedEvent.is_set():
self.logger.debug('Quitting connection')
await self._protocol.quit()
except (ConnectionRefusedError, ssl.SSLError, asyncio.TimeoutError) as e:
self.logger.error(str(e))


Loading…
Cancel
Save