plugin: Add debug log entries when calling and returning from hooks

This commit is contained in:
Christian Decker 2021-06-03 15:40:35 +02:00 committed by Rusty Russell
parent 610d8a0a74
commit 76b8eb3afd
1 changed files with 5 additions and 0 deletions

View File

@ -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,