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

Function init_log_hdr

lightningd/log.c:625–651  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

623}
624
625static void init_log_hdr(const struct logger *log,
626 struct log_hdr *l,
627 enum log_level level,
628 const struct node_id *node_id,
629 size_t msglen, size_t iolen)
630{
631 l->time = clock_time();
632 l->level = level;
633 l->prefix = log_prefix_get(log->prefix);
634 l->msglen = msglen;
635 l->iolen = iolen;
636 if (!node_id)
637 node_id = log->default_node_id;
638 if (node_id) {
639 l->nc = node_id_map_get(log->log_book->cache, node_id);
640 if (!l->nc) {
641 l->nc = tal(log->log_book->cache, struct node_id_cache);
642 l->nc->count = 0;
643 l->nc->node_id = *node_id;
644 node_id_map_add(log->log_book->cache, l->nc);
645 tal_add_destructor2(l->nc, destroy_node_id_cache,
646 log->log_book);
647 }
648 l->nc->count++;
649 } else
650 l->nc = NULL;
651}
652
653void logv(struct logger *log, enum log_level level,
654 const struct node_id *node_id,

Callers 2

logvFunction · 0.85
log_ioFunction · 0.85

Calls 2

clock_timeFunction · 0.85
log_prefix_getFunction · 0.85

Tested by

no test coverage detected