| 1234 | } |
| 1235 | |
| 1236 | static void plugin_logv(struct plugin *p, enum log_level l, |
| 1237 | const char *fmt, va_list ap) |
| 1238 | { |
| 1239 | struct json_stream *js = new_json_stream(NULL, NULL, NULL); |
| 1240 | |
| 1241 | json_object_start(js, NULL); |
| 1242 | json_add_string(js, "jsonrpc", "2.0"); |
| 1243 | json_add_string(js, "method", "log"); |
| 1244 | |
| 1245 | json_object_start(js, "params"); |
| 1246 | json_add_string(js, "level", |
| 1247 | l == LOG_DBG ? "debug" |
| 1248 | : l == LOG_INFORM ? "info" |
| 1249 | : l == LOG_UNUSUAL ? "warn" |
| 1250 | : "error"); |
| 1251 | json_out_addv(js->jout, "message", true, fmt, ap); |
| 1252 | json_object_end(js); |
| 1253 | |
| 1254 | jsonrpc_finish_and_send(p, js); |
| 1255 | } |
| 1256 | |
| 1257 | struct json_stream *plugin_notification_start(struct plugin *plugin, |
| 1258 | const char *method) |
no test coverage detected