Skip to content

Commit f79ab8a

Browse files
authored
file: delete outdated files after rotate (#15)
1 parent 10cf3e3 commit f79ab8a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: file.go

+4
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,10 @@ func (l *fileLogger) write(m Messager) (int, error) {
199199
l.openDay = now.Day()
200200
l.currentSize = 0
201201
l.currentLines = 0
202+
203+
if err := l.deleteOutdatedFiles(); err != nil {
204+
return bytesWrote, fmt.Errorf("delete outdated file: %v", err)
205+
}
202206
}
203207
}
204208
return bytesWrote, nil

0 commit comments

Comments
 (0)