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

Function init_log_hdr

lightningd/log.c:634–660  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

632}
633
634static void init_log_hdr(const struct logger *log,
635 struct log_hdr *l,
636 enum log_level level,
637 const struct node_id *node_id,
638 size_t msglen, size_t iolen)
639{
640 l->time = clock_time();
641 l->level = level;
642 l->prefix = log_prefix_get(log->prefix);
643 l->msglen = msglen;
644 l->iolen = iolen;
645 if (!node_id)
646 node_id = log->default_node_id;
647 if (node_id) {
648 l->nc = node_id_map_get(log->log_book->cache, node_id);
649 if (!l->nc) {
650 l->nc = tal(log->log_book->cache, struct node_id_cache);
651 l->nc->count = 0;
652 l->nc->node_id = *node_id;
653 node_id_map_add(log->log_book->cache, l->nc);
654 tal_add_destructor2(l->nc, destroy_node_id_cache,
655 log->log_book);
656 }
657 l->nc->count++;
658 } else
659 l->nc = NULL;
660}
661
662void logv(struct logger *log, enum log_level level,
663 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