3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-24 03:29:28 +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,8 +267,8 @@ 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():
# Only start a disconnection process if one doesn't already # Only start a disconnection process if one doesn't already
@ -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)