mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-03 16:39:25 +01:00
Fixed verbose logging of command times to only print once for threaded commands.
This commit is contained in:
parent
ce1435a55f
commit
f76dedd795
@ -250,10 +250,7 @@ class IrcObjectProxy:
|
|||||||
(self.msg.nick, name))
|
(self.msg.nick, name))
|
||||||
return
|
return
|
||||||
command = getattr(callback, name)
|
command = getattr(callback, name)
|
||||||
start = time.time()
|
|
||||||
callback.callCommand(command, self, self.msg, self.args)
|
callback.callCommand(command, self, self.msg, self.args)
|
||||||
elapsed = time.time() - start
|
|
||||||
debug.msg('%s took %s seconds.' % (name, elapsed), 'verbose')
|
|
||||||
else:
|
else:
|
||||||
self.args.insert(0, name)
|
self.args.insert(0, name)
|
||||||
self.reply(self.msg, '[%s]' % ' '.join(self.args))
|
self.reply(self.msg, '[%s]' % ' '.join(self.args))
|
||||||
@ -361,7 +358,11 @@ class Privmsg(irclib.IrcCallback):
|
|||||||
else:
|
else:
|
||||||
# Exceptions aren't caught here because IrcObjectProxy.finalEval
|
# Exceptions aren't caught here because IrcObjectProxy.finalEval
|
||||||
# catches them and does The Right Thing.
|
# catches them and does The Right Thing.
|
||||||
|
start = time.time()
|
||||||
f(irc, msg, args)
|
f(irc, msg, args)
|
||||||
|
elapsed = time.time() - start
|
||||||
|
funcname = f.im_func.func_name
|
||||||
|
debug.msg('%s took %s seconds' % (funcname, elapsed), 'verbose')
|
||||||
|
|
||||||
_r = re.compile(r'^(\w+)')
|
_r = re.compile(r'^(\w+)')
|
||||||
def doPrivmsg(self, irc, msg):
|
def doPrivmsg(self, irc, msg):
|
||||||
|
Loading…
Reference in New Issue
Block a user