1
0
Fork 0
mirror of https://github.com/eosswedenorg/thalos synced 2026-06-16 04:24:56 +02:00
thalos/internal/log/RotatingFileOptions.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
}
}