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

Function print_level

lightningd/log.c:519–546  ·  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

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

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