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

Function new_logger

lightningd/log.c:554–584  ·  view source on GitHub ↗

With different entry points */

Source from the content-addressed store, hash-verified

552
553/* With different entry points */
554struct logger *
555new_logger(const tal_t *ctx, struct log_book *log_book,
556 const struct node_id *default_node_id,
557 const char *fmt, ...)
558{
559 struct logger *log = tal(ctx, struct logger);
560 va_list ap;
561
562 log->log_book = tal_link(log, log_book);
563 va_start(ap, fmt);
564 /* Owned by the log book itself, since it can be referenced
565 * by log entries, too */
566 log->prefix = log_prefix_new(log->log_book, take(tal_vfmt(NULL, fmt, ap)));
567 va_end(ap);
568 log->default_node_id = tal_dup_or_null(log, struct node_id,
569 default_node_id);
570
571 /* Still initializing? Print UNUSUAL / BROKEN messages only */
572 if (!log->log_book->default_print_level) {
573 log->print_level = LOG_UNUSUAL;
574 log->need_refiltering = false;
575 } else {
576 log->print_level = print_level(log->log_book,
577 log->prefix,
578 default_node_id,
579 &log->need_refiltering);
580 }
581 list_add(&log->log_book->loggers, &log->list);
582 tal_add_destructor(log, destroy_logger);
583 return log;
584}
585
586const char *log_prefix(const struct logger *log)
587{

Callers 8

new_unsaved_channelFunction · 0.70
new_channelFunction · 0.70
new_subdFunction · 0.70
plugins_newFunction · 0.70
plugin_registerFunction · 0.70
new_uncommitted_channelFunction · 0.70
jcon_connectedFunction · 0.70
new_lightningdFunction · 0.70

Calls 2

log_prefix_newFunction · 0.85
print_levelFunction · 0.85

Tested by

no test coverage detected