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

Function new_log_book

lightningd/log.c:496–515  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

494}
495
496struct log_book *new_log_book(struct lightningd *ld)
497{
498 struct log_book *log_book = tal_linkable(tal(NULL, struct log_book));
499
500 log_book->ringbuf_start = log_book->ringbuf_end = 0;
501 log_book->log_files = NULL;
502 log_book->default_print_level = NULL;
503 /* We have to allocate this, since we tal_free it on resetting */
504 log_book->prefix = tal_strdup(log_book, "");
505 list_head_init(&log_book->print_filters);
506 list_head_init(&log_book->loggers);
507 log_book->init_time = clock_time();
508 log_book->ld = ld;
509 log_book->cache = tal(log_book, struct node_id_map);
510 node_id_map_init(log_book->cache);
511 log_book->print_timestamps = true;
512 tal_add_destructor(log_book, destroy_log_book);
513
514 return log_book;
515}
516
517/* What's the minimum level to print this prefix and node_id for this
518 * 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