Skip to content

Commit

Permalink
internal/log/RotatingFileOptions.go: add WithTimestampFormat function
Browse files Browse the repository at this point in the history
  • Loading branch information
pnx committed Feb 21, 2024
1 parent a66f180 commit d6a7bcd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions internal/log/RotatingFileOptions.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ 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
Expand Down

0 comments on commit d6a7bcd

Please sign in to comment.