MCPcopy Create free account
hub / github.com/ElementsProject/lightning / plugin_notify_message

Function plugin_notify_message

plugins/libplugin.c:1298–1322  ·  view source on GitHub ↗

Convenience wrapper for notify with "message" */

Source from the content-addressed store, hash-verified

1296
1297/* Convenience wrapper for notify with "message" */
1298void plugin_notify_message(struct command *cmd,
1299 enum log_level level,
1300 const char *fmt, ...)
1301{
1302 va_list ap;
1303 struct json_stream *js;
1304 const char *msg;
1305
1306 va_start(ap, fmt);
1307 msg = tal_vfmt(tmpctx, fmt, ap);
1308 va_end(ap);
1309
1310 /* Also log, debug level */
1311 plugin_log(cmd->plugin, LOG_DBG, "notify msg %s: %s",
1312 log_level_name(level), msg);
1313
1314 js = plugin_notify_start(cmd, "message");
1315 json_add_string(js, "level", log_level_name(level));
1316
1317 /* In case we're OOM */
1318 if (js->jout)
1319 json_out_addstr(js->jout, "message", msg);
1320
1321 plugin_notify_end(cmd, js);
1322}
1323
1324void plugin_notify_progress(struct command *cmd,
1325 u32 num_stages, u32 stage,

Callers 3

json_helloworldFunction · 0.85
connect_directFunction · 0.85
json_getrouteFunction · 0.85

Calls 6

plugin_notify_startFunction · 0.85
json_out_addstrFunction · 0.85
plugin_notify_endFunction · 0.85
plugin_logFunction · 0.70
log_level_nameFunction · 0.50
json_add_stringFunction · 0.50

Tested by 1

json_helloworldFunction · 0.68