Add the channel where a command has been called in the logs ('XXX called by XXX').

Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
This commit is contained in:
Valentin Lorentz 2012-03-18 20:45:17 +01:00 committed by James McCoy
parent 6f1b60c0f3
commit 741599c947

View File

@ -1166,7 +1166,12 @@ class Commands(BasePlugin):
method(irc, msg, *args, **kwargs)
def _callCommand(self, command, irc, msg, *args, **kwargs):
self.log.info('%s called by %q.', formatCommand(command), msg.prefix)
if irc.nick == msg.args[0]:
self.log.info('%s called in private by %q.', formatCommand(command),
msg.prefix)
else:
self.log.info('%s called on %s by %q.', formatCommand(command),
msg.args[0], msg.prefix)
# XXX I'm being extra-special-careful here, but we need to refactor
# this.
try: