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

Function new_logger

lightningd/log.c:545–575  ·  view source on GitHub ↗

With different entry points */

Source from the content-addressed store, hash-verified

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

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