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

Function logging_options_parsed

lightningd/log.c:1018–1053  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1016}
1017
1018void logging_options_parsed(struct log_book *log_book)
1019{
1020 struct logger *log;
1021 size_t off;
1022 const char *msg;
1023 const u8 *io;
1024 struct log_hdr l;
1025
1026 /* If they didn't set an explicit level, set to info */
1027 if (!log_book->default_print_level) {
1028 log_book->default_print_level = tal(log_book, enum log_level);
1029 *log_book->default_print_level = DEFAULT_LOGLEVEL;
1030 }
1031
1032 /* Set print_levels for each log, depending on filters. */
1033 list_for_each(&log_book->loggers, log, list) {
1034 log->print_level = print_level(log_book,
1035 log->prefix,
1036 log->default_node_id,
1037 &log->need_refiltering);
1038 }
1039
1040 /* Catch up, since before we were only printing BROKEN msgs */
1041 off = 0;
1042 while (get_log_entry(tmpctx, log_book, &l, &msg, &io, &off)) {
1043 if (l.level >= print_level(log_book, l.prefix, l.nc ? &l.nc->node_id : NULL, NULL))
1044 log_to_files(log_book->prefix, l.prefix->prefix, l.level,
1045 l.nc ? &l.nc->node_id : NULL,
1046 &log_book->print_filters,
1047 &l.time, msg, l.msglen,
1048 io, l.iolen,
1049 log_book->print_timestamps,
1050 log_book->default_print_level,
1051 log_book->log_files);
1052 }
1053}
1054
1055void log_backtrace_print(const char *fmt, ...)
1056{

Callers 1

handle_early_optsFunction · 0.85

Calls 3

print_levelFunction · 0.85
get_log_entryFunction · 0.85
log_to_filesFunction · 0.85

Tested by

no test coverage detected