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

Function rotate_log

lightningd/log.c:925–939  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

923static struct io_plan *setup_read(struct io_conn *conn, struct lightningd *ld);
924
925static struct io_plan *rotate_log(struct io_conn *conn, struct lightningd *ld)
926{
927 log_info(ld->log, "Ending log due to SIGHUP");
928 for (size_t i = 0; i < tal_count(ld->log->log_book->log_files); i++) {
929 if (streq(ld->logfiles[i], "-"))
930 continue;
931 fclose(ld->log->log_book->log_files[i]->f);
932 ld->log->log_book->log_files[i]->f = fopen(ld->logfiles[i], "a");
933 if (!ld->log->log_book->log_files[i]->f)
934 err(1, "failed to reopen log file %s", ld->logfiles[i]);
935 }
936
937 log_info(ld->log, "Started log due to SIGHUP");
938 return setup_read(conn, ld);
939}
940
941static struct io_plan *setup_read(struct io_conn *conn, struct lightningd *ld)
942{

Callers

nothing calls this directly

Calls 3

log_infoClass · 0.85
errFunction · 0.85
setup_readFunction · 0.85

Tested by

no test coverage detected