mirror of
https://github.com/eosswedenorg/thalos
synced 2026-06-16 04:24:56 +02:00
25 lines
440 B
Go
25 lines
440 B
Go
package log
|
|
|
|
import "time"
|
|
|
|
type RotatingFileOption func(*RotatingFile)
|
|
|
|
func WithTimestampFormat(value string) RotatingFileOption {
|
|
return func(f *RotatingFile) {
|
|
if len(value) > 0 {
|
|
f.format = value
|
|
}
|
|
}
|
|
}
|
|
|
|
func WithMaxSize(value int64) RotatingFileOption {
|
|
return func(f *RotatingFile) {
|
|
f.maxSize = value
|
|
}
|
|
}
|
|
|
|
func WithMaxAge(value time.Duration) RotatingFileOption {
|
|
return func(f *RotatingFile) {
|
|
f.maxAge = value
|
|
}
|
|
}
|