From 76b8eb3afda4905dbeb059f88b2bbe994cbaa50a Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Thu, 3 Jun 2021 15:40:35 +0200 Subject: [PATCH] plugin: Add debug log entries when calling and returning from hooks --- lightningd/plugin_hook.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lightningd/plugin_hook.c b/lightningd/plugin_hook.c index e5a3cbbff..16c62b187 100644 --- a/lightningd/plugin_hook.c +++ b/lightningd/plugin_hook.c @@ -163,6 +163,9 @@ static void plugin_hook_callback(const char *buffer, const jsmntok_t *toks, struct plugin_hook_call_link *last, *it; bool in_transaction = false; + log_debug(r->ld->log, "Plugin %s returned from %s hook call", + r->plugin->shortname, r->hook->name); + if (r->ld->state == LD_STATE_SHUTDOWN) { log_debug(r->ld->log, "Abandoning plugin hook call due to shutdown"); @@ -227,6 +230,8 @@ static void plugin_hook_call_next(struct plugin_hook_request *ph_req) assert(!list_empty(&ph_req->call_chain)); ph_req->plugin = list_top(&ph_req->call_chain, struct plugin_hook_call_link, list)->plugin; + log_debug(ph_req->ld->log, "Calling %s hook of plugin %s", + ph_req->hook->name, ph_req->plugin->shortname); req = jsonrpc_request_start(NULL, hook->name, plugin_get_log(ph_req->plugin), NULL,