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

Function log_dump_to_file

lightningd/log.c:1067–1083  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1065}
1066
1067static void log_dump_to_file(int fd, const struct log_book *log_book)
1068{
1069 char buf[100];
1070 int len;
1071 struct log_data data;
1072 time_t start;
1073
1074 start = log_book->init_time.ts.tv_sec;
1075 len = snprintf(buf, sizeof(buf), "%zu bytes, %s", ringbuf_used(log_book), ctime(&start));
1076 write_all(fd, buf, len);
1077
1078 /* ctime includes \n... WTF? */
1079 data.prefix = "";
1080 data.fd = fd;
1081 log_each_line(log_book, log_one_line, &data);
1082 write_all(fd, "\n\n", strlen("\n\n"));
1083}
1084
1085void log_backtrace_exit(void)
1086{

Callers 1

log_backtrace_exitFunction · 0.85

Calls 2

ringbuf_usedFunction · 0.85
write_allFunction · 0.50

Tested by

no test coverage detected