lightningd: suppress IO_OUT logging for getlog command

Before this, the response of `getlog io` blew up quickly
when called multiple times.
This commit is contained in:
Simon Vrouwe
2019-05-23 13:09:17 +03:00
committed by Rusty Russell
parent 8feb05aef4
commit db57d9c5d2
5 changed files with 24 additions and 0 deletions

View File

@@ -515,6 +515,16 @@ struct json_stream *json_stream_raw_for_cmd(struct command *cmd)
return js;
}
void json_stream_log_suppress_for_cmd(struct json_stream *js,
const struct command *cmd)
{
const char *nm = cmd->json_cmd->name;
const char *s = tal_fmt(tmpctx, "Suppressing logging of %s command", nm);
log_io(cmd->jcon->log, LOG_IO_OUT, s, NULL, 0);
json_stream_log_suppress(js, strdup(nm));
}
static struct json_stream *json_start(struct command *cmd)
{
struct json_stream *js = json_stream_raw_for_cmd(cmd);