Skip to content

Commit 8f2e51d

Browse files
committed
timberjack_tests
1 parent d055776 commit 8f2e51d

File tree

2 files changed

+814
-1
lines changed

2 files changed

+814
-1
lines changed

timberjack.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ func (l *Logger) Write(p []byte) (n int, err error) {
150150
}
151151

152152
// 1. Time-based rotation
153-
if l.RotationInterval > 0 && time.Since(l.lastRotationTime) >= l.RotationInterval {
153+
if l.RotationInterval > 0 && currentTime().Sub(l.lastRotationTime) >= l.RotationInterval {
154154
if err := l.rotate(); err != nil {
155155
return 0, err
156156
}

0 commit comments

Comments
 (0)