Skip to content

Commit

Permalink
plugin: Add debug log entries when calling and returning from hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
cdecker authored and rustyrussell committed Jun 5, 2021
1 parent 66b5289 commit 5dc4b55
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lightningd/plugin_hook.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 5dc4b55

Please sign in to comment.