Skip to content

Commit be6a140

Browse files
Lagrang3ShahanaFarooqui
authored andcommitted
libplugin: fix LOG_TRACE for plugins
A log event LOG_TRACE submitted by a plugin was being logged as **BROKEN** by lightningd before this commit. Changelog-Fixed: plugins can now log events under the LOG_TRACE flag. Signed-off-by: Lagrang3 <[email protected]>
1 parent 3da1bdb commit be6a140

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lightningd/plugin.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ static const char *plugin_log_handle(struct plugin *plugin,
498498
|| level == LOG_IO_OUT) {
499499
return tal_fmt(plugin,
500500
"Unknown log-level %.*s, valid values are "
501-
"\"debug\", \"info\", \"warn\", or \"error\".",
501+
"\"trace\", \"debug\", \"info\", \"warn\", or \"error\".",
502502
json_tok_full_len(leveltok),
503503
json_tok_full(plugin->buffer, leveltok));
504504
}

plugins/libplugin.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1835,7 +1835,8 @@ void plugin_logv(struct plugin *p, enum log_level l,
18351835

18361836
json_object_start(js, "params");
18371837
json_add_string(js, "level",
1838-
l == LOG_DBG ? "debug"
1838+
l == LOG_TRACE ? "trace"
1839+
: l == LOG_DBG ? "debug"
18391840
: l == LOG_INFORM ? "info"
18401841
: l == LOG_UNUSUAL ? "warn"
18411842
: l == LOG_TRACE ? "trace"

0 commit comments

Comments
 (0)