3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-27 21:19:31 +01:00

Irc: raise connection failure log levels to error

This commit is contained in:
James Lu 2016-04-25 19:14:34 -07:00
parent 84503a2ead
commit 3b04d1abdc

View File

@ -267,7 +267,7 @@ class Irc():
except (socket.error, ProtocolError, ConnectionError) as e: except (socket.error, ProtocolError, ConnectionError) as e:
# self.run() or the protocol module it called raised an # self.run() or the protocol module it called raised an
# exception, meaning we've disconnected! # exception, meaning we've disconnected!
log.warning('(%s) Disconnected from IRC: %s: %s', log.error('(%s) Disconnected from IRC: %s: %s',
self.name, type(e).__name__, str(e)) self.name, type(e).__name__, str(e))
if not self.aborted.is_set(): if not self.aborted.is_set():
@ -336,10 +336,10 @@ class Irc():
buf += data buf += data
if not data: if not data:
log.warning('(%s) No data received, disconnecting!', self.name) log.error('(%s) No data received, disconnecting!', self.name)
return return
elif (time.time() - self.lastping) > self.pingtimeout: elif (time.time() - self.lastping) > self.pingtimeout:
log.warning('(%s) Connection timed out.', self.name) log.error('(%s) Connection timed out.', self.name)
return return
while b'\n' in buf: while b'\n' in buf:
line, buf = buf.split(b'\n', 1) line, buf = buf.split(b'\n', 1)