|
|
@ -358,14 +358,16 @@ func createOutput(path string) (io.WriteCloser, error) {
|
|
|
|
return nil, ErrLogPathNotSet
|
|
|
|
return nil, ErrLogPathNotSet
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var rule RotateRule
|
|
|
|
switch options.rotationRule {
|
|
|
|
switch options.rotationRule {
|
|
|
|
case sizeRotationRule:
|
|
|
|
case sizeRotationRule:
|
|
|
|
return NewLogger(path, NewSizeLimitRotateRule(path, backupFileDelimiter, options.keepDays,
|
|
|
|
rule = NewSizeLimitRotateRule(path, backupFileDelimiter, options.keepDays, options.maxSize,
|
|
|
|
options.maxSize, options.maxBackups, options.gzipEnabled), options.gzipEnabled)
|
|
|
|
options.maxBackups, options.gzipEnabled)
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
return NewLogger(path, DefaultRotateRule(path, backupFileDelimiter, options.keepDays,
|
|
|
|
rule = DefaultRotateRule(path, backupFileDelimiter, options.keepDays, options.gzipEnabled)
|
|
|
|
options.gzipEnabled), options.gzipEnabled)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return NewLogger(path, rule, options.gzipEnabled)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func getWriter() Writer {
|
|
|
|
func getWriter() Writer {
|
|
|
|