plugin: add log-level to plugin_kill, make it take format string.

We currently log every kill at INFO level, even if it's during shutdown.
Change those to debug, but lift those where we got a malformed response.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2021-02-11 11:39:31 +10:30
committed by Christian Decker
parent 7885d12eca
commit a9aad0da98
3 changed files with 33 additions and 13 deletions

View File

@@ -113,7 +113,8 @@ plugin_dynamic_stop(struct command *cmd, const char *plugin_name)
"%s cannot be managed when "
"lightningd is up",
plugin_name);
plugin_kill(p, "stopped by lightningd via RPC");
plugin_kill(p, LOG_INFORM,
"stopped by lightningd via RPC");
response = json_stream_success(cmd);
json_add_string(response, "result",
take(tal_fmt(NULL, "Successfully stopped %s.",