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

Method Rotate

lumberjack.go:186–190  ·  view source on GitHub ↗

Rotate causes Logger to close the existing log file and immediately create a new one. This is a helper function for applications that want to initiate rotations outside of the normal rotation rules, such as in response to SIGHUP. After rotating, this initiates compression and removal of old log fi

()

Source from the content-addressed store, hash-verified

184// SIGHUP. After rotating, this initiates compression and removal of old log
185// files according to the configuration.
186func (l *Logger) Rotate() error {
187 l.mu.Lock()
188 defer l.mu.Unlock()
189 return l.rotate()
190}
191
192// rotate closes the current file, moves it aside with a timestamp in the name,
193// (if it exists), opens a new file with the original filename, and then runs

Callers 7

TestMaintainModeFunction · 0.95
TestMaintainOwnerFunction · 0.95
TestCompressMaintainModeFunction · 0.95
ExampleLogger_RotateFunction · 0.95
TestRotateFunction · 0.95
TestCompressOnRotateFunction · 0.95

Calls 1

rotateMethod · 0.95

Tested by 7

TestMaintainModeFunction · 0.76
TestMaintainOwnerFunction · 0.76
TestCompressMaintainModeFunction · 0.76
ExampleLogger_RotateFunction · 0.76
TestRotateFunction · 0.76
TestCompressOnRotateFunction · 0.76