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

Function plugin_notify_message

plugins/libplugin.c:1923–1947  ·  view source on GitHub ↗

Convenience wrapper for notify with "message" */

Source from the content-addressed store, hash-verified

1921
1922/* Convenience wrapper for notify with "message" */
1923void plugin_notify_message(struct command *cmd,
1924 enum log_level level,
1925 const char *fmt, ...)
1926{
1927 va_list ap;
1928 struct json_stream *js;
1929 const char *msg;
1930
1931 va_start(ap, fmt);
1932 msg = tal_vfmt(tmpctx, fmt, ap);
1933 va_end(ap);
1934
1935 /* Also log, debug level */
1936 plugin_log(cmd->plugin, LOG_DBG, "notify msg %s: %s",
1937 log_level_name(level), msg);
1938
1939 js = plugin_notify_start(cmd, "message");
1940 json_add_string(js, "level", log_level_name(level));
1941
1942 /* In case we're OOM */
1943 if (js->jout)
1944 json_out_addstr(js->jout, "message", msg);
1945
1946 plugin_notify_end(cmd, js);
1947}
1948
1949void plugin_notify_progress(struct command *cmd,
1950 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