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

Function plugin_notify_message

plugins/libplugin.c:1933–1957  ·  view source on GitHub ↗

Convenience wrapper for notify with "message" */

Source from the content-addressed store, hash-verified

1931
1932/* Convenience wrapper for notify with "message" */
1933void plugin_notify_message(struct command *cmd,
1934 enum log_level level,
1935 const char *fmt, ...)
1936{
1937 va_list ap;
1938 struct json_stream *js;
1939 const char *msg;
1940
1941 va_start(ap, fmt);
1942 msg = tal_vfmt(tmpctx, fmt, ap);
1943 va_end(ap);
1944
1945 /* Also log, debug level */
1946 plugin_log(cmd->plugin, LOG_DBG, "notify msg %s: %s",
1947 log_level_name(level), msg);
1948
1949 js = plugin_notify_start(cmd, "message");
1950 json_add_string(js, "level", log_level_name(level));
1951
1952 /* In case we're OOM */
1953 if (js->jout)
1954 json_out_addstr(js->jout, "message", msg);
1955
1956 plugin_notify_end(cmd, js);
1957}
1958
1959void plugin_notify_progress(struct command *cmd,
1960 u32 num_stages, u32 stage,

Callers 5

param_invreqFunction · 0.70
json_emergencyrecoverFunction · 0.70
try_routeFunction · 0.70
json_helloworldFunction · 0.50

Calls 6

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

Tested by 1

json_helloworldFunction · 0.40