| 485 | } |
| 486 | |
| 487 | struct 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. */ |
no test coverage detected