mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-11 04:32:36 +01:00
Updated the logging of various things that need logged.
This commit is contained in:
parent
5fb21b5d06
commit
8242302a07
@ -89,6 +89,8 @@ def checkCapability(f, capability):
|
|||||||
if ircdb.checkCapability(msg.prefix, capability):
|
if ircdb.checkCapability(msg.prefix, capability):
|
||||||
f(self, irc, msg, args)
|
f(self, irc, msg, args)
|
||||||
else:
|
else:
|
||||||
|
self.log.warning('%r attempted %s without %s.',
|
||||||
|
msg.prefix, f.func_name, capability)
|
||||||
irc.error(msg, conf.replyNoCapability % capability)
|
irc.error(msg, conf.replyNoCapability % capability)
|
||||||
newf = types.FunctionType(newf.func_code, newf.func_globals,
|
newf = types.FunctionType(newf.func_code, newf.func_globals,
|
||||||
f.func_name, closure=newf.func_closure)
|
f.func_name, closure=newf.func_closure)
|
||||||
@ -108,6 +110,8 @@ def checkChannelCapability(f, capability):
|
|||||||
ff = types.MethodType(f, self, self.__class__)
|
ff = types.MethodType(f, self, self.__class__)
|
||||||
ff(irc, msg, args, *L)
|
ff(irc, msg, args, *L)
|
||||||
else:
|
else:
|
||||||
|
self.log.warning('%r attempted %s without %s.',
|
||||||
|
msg.prefix, f.func_name, capability)
|
||||||
irc.error(msg, conf.replyNoCapability % chancap)
|
irc.error(msg, conf.replyNoCapability % chancap)
|
||||||
newf = types.FunctionType(newf.func_code, newf.func_globals,
|
newf = types.FunctionType(newf.func_code, newf.func_globals,
|
||||||
f.func_name, closure=newf.func_closure)
|
f.func_name, closure=newf.func_closure)
|
||||||
@ -170,7 +174,7 @@ def urlSnarfer(f):
|
|||||||
url = match.group(0)
|
url = match.group(0)
|
||||||
if any(lambda t: t[0] == url and t[1] == msg.args[0], q) and \
|
if any(lambda t: t[0] == url and t[1] == msg.args[0], q) and \
|
||||||
not world.testing:
|
not world.testing:
|
||||||
self.log.warning('Refusing to snarf %s.', url)
|
self.log.warning('Refusing to snarf %s from %r.', url, msg.prefix)
|
||||||
else:
|
else:
|
||||||
q.enqueue((url, msg.args[0], now))
|
q.enqueue((url, msg.args[0], now))
|
||||||
if self.threaded:
|
if self.threaded:
|
||||||
@ -196,6 +200,8 @@ class CapabilityCheckingPrivmsg(callbacks.Privmsg):
|
|||||||
if ircdb.checkCapability(msg.prefix, self.capability):
|
if ircdb.checkCapability(msg.prefix, self.capability):
|
||||||
callbacks.Privmsg.callCommand(self, f, irc, msg, args)
|
callbacks.Privmsg.callCommand(self, f, irc, msg, args)
|
||||||
else:
|
else:
|
||||||
|
self.log.warning('%r tried to call %s without %s.',
|
||||||
|
msg.prefix, f.im_func.func_name, self.capability)
|
||||||
irc.error(msg, conf.replyNoCapability % self.capability)
|
irc.error(msg, conf.replyNoCapability % self.capability)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user