add some more logging to the irc bot
This commit is contained in:
parent
7601b33b6a
commit
79cd7d73c4
|
@ -70,9 +70,10 @@ class Plugin(object):
|
||||||
"""
|
"""
|
||||||
#logger.debug("inside get_outgoing_messages()")
|
#logger.debug("inside get_outgoing_messages()")
|
||||||
for msg in OutgoingIrcMessage.objects.filter(processed=False).order_by('created'):
|
for msg in OutgoingIrcMessage.objects.filter(processed=False).order_by('created'):
|
||||||
|
logger.info("processing irc message to %s: %s" % (msg.target, msg.message))
|
||||||
# if this message expired mark it as expired and processed without doing anything
|
# if this message expired mark it as expired and processed without doing anything
|
||||||
if msg.timeout < timezone.now():
|
if msg.timeout < timezone.now():
|
||||||
# this message is expired
|
logger.info("this message is expired, marking it as such instead of sending it to irc")
|
||||||
msg.expired=True
|
msg.expired=True
|
||||||
msg.processed=True
|
msg.processed=True
|
||||||
msg.save()
|
msg.save()
|
||||||
|
@ -80,11 +81,12 @@ class Plugin(object):
|
||||||
|
|
||||||
# is this message for a channel or a nick?
|
# is this message for a channel or a nick?
|
||||||
if msg.target[0] == "#" and msg.target in self.bot.channels:
|
if msg.target[0] == "#" and msg.target in self.bot.channels:
|
||||||
logger.debug("sending privmsg to %s: %s" % (msg.target, msg.message))
|
logger.info("sending privmsg to %s: %s" % (msg.target, msg.message))
|
||||||
self.bot.privmsg(msg.target, msg.message)
|
self.bot.privmsg(msg.target, msg.message)
|
||||||
msg.processed=True
|
msg.processed=True
|
||||||
msg.save()
|
msg.save()
|
||||||
elif msg.target:
|
elif msg.target:
|
||||||
|
logger.info("sending privmsg to %s: %s" % (msg.target, msg.message))
|
||||||
self.bot.privmsg(msg.target, msg.message)
|
self.bot.privmsg(msg.target, msg.message)
|
||||||
msg.processed=True
|
msg.processed=True
|
||||||
msg.save()
|
msg.save()
|
||||||
|
|
Loading…
Reference in a new issue