3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-30 14:49:28 +01:00

log: split multi-line channel logs into multiple PRIVMSGs

Closes #175.
This commit is contained in:
James Lu 2016-03-16 15:38:07 -07:00
parent a8303d0110
commit abce18a5ba

13
log.py
View File

@ -101,10 +101,11 @@ class PyLinkChannelLogger(logging.Handler):
# Send the message. If this fails, abort. No more messages will be
# sent from this logger until the next sending succeeds.
try:
self.irc.msg(self.channel, msg)
except:
return
else:
self.called = False
for line in msg.splitlines():
try:
self.irc.msg(self.channel, line)
except:
return
else:
self.called = False