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

Function log_level_parse

common/status_levels.c:30–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28}
29
30bool log_level_parse(const char *levelstr, size_t len,
31 enum log_level *level)
32{
33 for (size_t i = 0; i < ARRAY_SIZE(ll_names); i++) {
34 if (streq_case(ll_names[i], levelstr, len)) {
35 *level = i;
36 return true;
37 }
38 }
39 /* We also allow "error" and "warn" */
40 if (streq_case("error", levelstr, len)) {
41 *level = LOG_BROKEN;
42 return true;
43 }
44 if (streq_case("warn", levelstr, len)) {
45 *level = LOG_UNUSUAL;
46 return true;
47 }
48
49 return false;
50}

Callers 5

plugin_log_handleFunction · 0.85
opt_log_levelFunction · 0.85
param_loglevelFunction · 0.85
handle_notifyFunction · 0.85
opt_set_levelFunction · 0.85

Calls 1

streq_caseFunction · 0.85

Tested by

no test coverage detected