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

Function opt_log_level

lightningd/log.c:582–602  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

580}
581
582char *opt_log_level(const char *arg, struct log *log)
583{
584 enum log_level level;
585 int len;
586
587 len = strcspn(arg, ":");
588 if (!log_level_parse(arg, len, &level))
589 return tal_fmt(NULL, "unknown log level %.*s", len, arg);
590
591 if (arg[len]) {
592 struct print_filter *f = tal(log->lr, struct print_filter);
593 f->prefix = arg + len + 1;
594 f->level = level;
595 list_add_tail(&log->lr->print_filters, &f->list);
596 } else {
597 tal_free(log->lr->default_print_level);
598 log->lr->default_print_level = tal(log->lr, enum log_level);
599 *log->lr->default_print_level = level;
600 }
601 return NULL;
602}
603
604void json_add_opt_log_levels(struct json_stream *response, struct log *log)
605{

Callers

nothing calls this directly

Calls 2

tal_freeFunction · 0.85
log_level_parseFunction · 0.50

Tested by

no test coverage detected