MCPcopy
hub / github.com/natefinch/lumberjack / rotate

Method rotate

lumberjack.go:195–204  ·  view source on GitHub ↗

rotate closes the current file, moves it aside with a timestamp in the name, (if it exists), opens a new file with the original filename, and then runs post-rotation processing and removal.

()

Source from the content-addressed store, hash-verified

193// (if it exists), opens a new file with the original filename, and then runs
194// post-rotation processing and removal.
195func (l *Logger) rotate() error {
196 if err := l.close(); err != nil {
197 return err
198 }
199 if err := l.openNew(); err != nil {
200 return err
201 }
202 l.mill()
203 return nil
204}
205
206// openNew opens a new log file for writing, moving any old log file out of the
207// way. This methods assumes the file has already been closed.

Callers 3

WriteMethod · 0.95
RotateMethod · 0.95
openExistingOrNewMethod · 0.95

Calls 3

closeMethod · 0.95
openNewMethod · 0.95
millMethod · 0.95

Tested by

no test coverage detected