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

Function logging_options_parsed

lightningd/log.c:1031–1066  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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