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

Function print_level

lightningd/log.c:510–537  ·  view source on GitHub ↗

What's the minimum level to print this prefix and node_id for this * log book? Saves us marshalling long print lines in most cases. */

Source from the content-addressed store, hash-verified

508/* What's the minimum level to print this prefix and node_id for this
509 * log book? Saves us marshalling long print lines in most cases. */
510static enum log_level print_level(struct log_book *log_book,
511 const struct log_prefix *lp,
512 const struct node_id *node_id,
513 bool *need_refiltering)
514{
515 enum log_level level = *log_book->default_print_level;
516 bool have_filters = false;
517
518 lowest_filter(&log_book->print_filters, lp->prefix, node_id, &level);
519 if (!list_empty(&log_book->print_filters))
520 have_filters = true;
521
522 /* We need to look into per-file filters as well: might give a
523 * lower filter! */
524 for (size_t i = 0; i < tal_count(log_book->log_files); i++) {
525 lowest_filter(&log_book->log_files[i]->print_filters,
526 lp->prefix, node_id, &level);
527 if (!list_empty(&log_book->log_files[i]->print_filters))
528 have_filters = true;
529 }
530
531 /* Almost any complex array of filters can mean we want to re-check
532 * when logging. */
533 if (need_refiltering)
534 *need_refiltering = have_filters;
535
536 return level;
537}
538
539static void destroy_logger(struct logger *log)
540{

Callers 4

new_loggerFunction · 0.85
log_has_io_loggingFunction · 0.85
log_has_trace_loggingFunction · 0.85
logging_options_parsedFunction · 0.85

Calls 1

lowest_filterFunction · 0.85

Tested by

no test coverage detected