Browse files

Remove extraneous hook logging.

This can actually cripple hook performance depending on the number of
registered hooks and their string representations ... even though the
log level is generally too low to actually *use* the string...

Signed-off-by: Jack Miller <>
  • Loading branch information...
1 parent 09b12b4 commit 7ca302e461c5d14efece41e52905878915038d1c @themoken committed Jul 17, 2012
Showing with 0 additions and 8 deletions.
  1. +0 −8 canto_next/
@@ -7,9 +7,6 @@
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
-import logging
-log = logging.getLogger("HOOK")
hooks = {}
# Since the inception of the work_done hook that's called from the main loop
@@ -18,7 +15,6 @@
# with -vv, but most of the time will be extraneous.
def on_hook(hook, func):
- log.log(8, "Registering func %s for hook: %s" % (func, hook))
if hook in hooks:
@@ -29,14 +25,10 @@ def remove_hook(hook, func):
def call_hook(hook, args):
- log.log(8, "Calling funcs for hook: %s" % hook)
if hook in hooks:
# List copy here so hooks can remove themselves
# without effecting our iteration.
for func in hooks[hook][:]:
- log.log(8, "\t%s(%s)" % (func, args))
- else:
- log.log(8, "\tNone.")

0 comments on commit 7ca302e

Please sign in to comment.