mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 18:11:28 +01:00
lightningd: debug log when we send a notification to a command.
For testing. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
ef45eacc95
commit
239f1a6ee6
@ -731,20 +731,27 @@ void json_notify_fmt(struct command *cmd,
|
||||
{
|
||||
va_list ap;
|
||||
struct json_stream *js;
|
||||
const char *msg;
|
||||
|
||||
va_start(ap, fmt);
|
||||
msg = tal_vfmt(tmpctx, fmt, ap);
|
||||
va_end(ap);
|
||||
|
||||
/* Help for tests */
|
||||
log_debug(cmd->ld->log, "NOTIFY %s %s %s",
|
||||
cmd->id, log_level_name(level), msg);
|
||||
if (!cmd->send_notifications)
|
||||
return;
|
||||
|
||||
js = json_stream_raw_for_cmd(cmd);
|
||||
|
||||
va_start(ap, fmt);
|
||||
json_object_start(js, NULL);
|
||||
json_add_string(js, "jsonrpc", "2.0");
|
||||
json_add_string(js, "method", "message");
|
||||
json_object_start(js, "params");
|
||||
json_add_id(js, cmd->id);
|
||||
json_add_string(js, "level", log_level_name(level));
|
||||
json_add_string(js, "message", tal_vfmt(tmpctx, fmt, ap));
|
||||
json_add_string(js, "message", msg);
|
||||
json_object_end(js);
|
||||
json_object_end(js);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user