mirror of
https://github.com/eosswedenorg/thalos
synced 2026-07-03 11:53:41 +02:00
internal/log/RotatingFileOptions.go: add WithTimestampFormat function
This commit is contained in:
parent
a66f1804da
commit
d6a7bcd2bb
1 changed files with 8 additions and 0 deletions
|
|
@ -4,6 +4,14 @@ import "time"
|
||||||
|
|
||||||
type RotatingFileOption func(*RotatingFile)
|
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 {
|
func WithMaxSize(value int64) RotatingFileOption {
|
||||||
return func(f *RotatingFile) {
|
return func(f *RotatingFile) {
|
||||||
f.maxSize = value
|
f.maxSize = value
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue