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

@@ -18,6 +18,7 @@
#include <lightningd/jsonrpc.h>
#include <lightningd/lightningd.h>
#include <lightningd/log.h>
#include <stdarg.h>
#include <unistd.h>
@@ -256,7 +257,8 @@ bool plugins_send_getmanifest(struct plugins *plugins);
/**
* Kill a plugin process and free @plugin, with an error message.
*/
void plugin_kill(struct plugin *plugin, const char *msg);
void plugin_kill(struct plugin *plugin, enum log_level loglevel,
const char *fmt, ...);
/**
* Returns the plugin which registers the command with name {cmd_name}