From fe16ce99153558d44c51a4d2648c1125417771bd Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Wed, 5 Nov 2008 12:23:06 +0100 Subject: [PATCH] Add debug messages for hooks when core debug >= 2 --- src/core/wee-hook.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/core/wee-hook.c b/src/core/wee-hook.c index 3f660b20e..bbb37c52c 100644 --- a/src/core/wee-hook.c +++ b/src/core/wee-hook.c @@ -236,6 +236,14 @@ hook_init_data (struct t_hook *hook, struct t_weechat_plugin *plugin, hook->running = 0; hook->callback_data = callback_data; hook->hook_data = NULL; + + if (weechat_debug_core >= 2) + { + gui_chat_printf (NULL, + "debug: adding hook: type=%d (%s), plugin=%lx (%s)", + hook->type, hook_type_string[hook->type], + hook->plugin, plugin_get_name (hook->plugin)); + } } /* @@ -1606,6 +1614,14 @@ unhook (struct t_hook *hook) /* hook already deleted? */ if (hook->deleted) return; + + if (weechat_debug_core >= 2) + { + gui_chat_printf (NULL, + "debug: removing hook: type=%d (%s), plugin=%lx (%s)", + hook->type, hook_type_string[hook->type], + hook->plugin, plugin_get_name (hook->plugin)); + } /* free data */ if (hook->hook_data)