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

Function new_log_book

lightningd/log.c:487–506  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

485}
486
487struct log_book *new_log_book(struct lightningd *ld)
488{
489 struct log_book *log_book = tal_linkable(tal(NULL, struct log_book));
490
491 log_book->ringbuf_start = log_book->ringbuf_end = 0;
492 log_book->log_files = NULL;
493 log_book->default_print_level = NULL;
494 /* We have to allocate this, since we tal_free it on resetting */
495 log_book->prefix = tal_strdup(log_book, "");
496 list_head_init(&log_book->print_filters);
497 list_head_init(&log_book->loggers);
498 log_book->init_time = clock_time();
499 log_book->ld = ld;
500 log_book->cache = tal(log_book, struct node_id_map);
501 node_id_map_init(log_book->cache);
502 log_book->print_timestamps = true;
503 tal_add_destructor(log_book, destroy_log_book);
504
505 return log_book;
506}
507
508/* What's the minimum level to print this prefix and node_id for this
509 * log book? Saves us marshalling long print lines in most cases. */

Callers 1

new_lightningdFunction · 0.70

Calls 2

list_head_initFunction · 0.85
clock_timeFunction · 0.85

Tested by

no test coverage detected