fix(cli): fix three log journal defects and test Windows with the race detector

This commit is contained in:
Anthony Wong authored and Cuong Manh Le committed 2026-10-06 14:52:42 +07:00
1 parent 462f912495
commit db228a86ae
13 files changed
+505 -31

No files matched your search

+10 -3
View File
@@ -159,13 +159,20 @@ func (p *prog) refreshLogHeader() {
// writeLogHeaders puts the header at the append point of each open file. A
// header that cannot land leaves the file usable, so the error only earns a
// warning.
func (p *prog) writeLogHeaders() {
// warning. It returns the rotations that the headers caused, because the
// logger does not reach the files yet and cannot report them.
func (p *prog) writeLogHeaders() []logRotation {
var rotations []logRotation
for _, rf := range p.openLogFiles() {
if err := rf.writeHeader(); err != nil {
rotated, err := rf.writeHeaderReporting()
if rotated != nil {
rotations = append(rotations, *rotated)
}
if err != nil {
mainLog.Load().Warn().Err(err).Msg("could not write log header")
}
}
return rotations
}
func prefixStrings(prefixes []netip.Prefix) []string {