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

Function log_dump_to_file

lightningd/log.c:1080–1096  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1078}
1079
1080static void log_dump_to_file(int fd, const struct log_book *log_book)
1081{
1082 char buf[100];
1083 int len;
1084 struct log_data data;
1085 time_t start;
1086
1087 start = log_book->init_time.ts.tv_sec;
1088 len = snprintf(buf, sizeof(buf), "%zu bytes, %s", ringbuf_used(log_book), ctime(&start));
1089 write_all(fd, buf, len);
1090
1091 /* ctime includes \n... WTF? */
1092 data.prefix = "";
1093 data.fd = fd;
1094 log_each_line(log_book, log_one_line, &data);
1095 write_all(fd, "\n\n", strlen("\n\n"));
1096}
1097
1098void log_backtrace_exit(void)
1099{

Callers 1

log_backtrace_exitFunction · 0.85

Calls 2

ringbuf_usedFunction · 0.85
write_allFunction · 0.50

Tested by

no test coverage detected