mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-06 15:44:21 +01:00
Use common loglevel JSON parser.
This now means we can ask for IO logs for peers, too (that case was missing!) Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -944,15 +944,7 @@ static void json_listpeers(struct command *cmd,
|
||||
}
|
||||
if (leveltok) {
|
||||
gpa->ll = tal(gpa, enum log_level);
|
||||
if (json_tok_streq(buffer, leveltok, "debug"))
|
||||
*gpa->ll = LOG_DBG;
|
||||
else if (json_tok_streq(buffer, leveltok, "info"))
|
||||
*gpa->ll = LOG_INFORM;
|
||||
else if (json_tok_streq(buffer, leveltok, "unusual"))
|
||||
*gpa->ll = LOG_UNUSUAL;
|
||||
else if (json_tok_streq(buffer, leveltok, "broken"))
|
||||
*gpa->ll = LOG_BROKEN;
|
||||
else {
|
||||
if (!json_tok_loglevel(buffer, leveltok, gpa->ll)) {
|
||||
command_fail(cmd, "Invalid level param");
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user