8 strftime "github.com/lestrrat-go/strftime"
11 type Handler interface {
15 type HandlerFunc func(Event)
17 type Event interface {
24 InvalidEventType EventType = iota
28 type FileRotatedEvent struct {
29 prev string // previous filename
30 current string // current, new filename
33 // RotateLogs represents a log file that gets
34 // automatically rotated as you write to it.
35 type RotateLogs struct {
46 pattern *strftime.Strftime
47 rotationTime time.Duration
52 // Clock is the interface used by the RotateLogs
53 // object to determine the current time
54 type Clock interface {
57 type clockFn func() time.Time
59 // UTC is an object satisfying the Clock interface, which
60 // returns the current time in UTC
61 var UTC = clockFn(func() time.Time { return time.Now().UTC() })
63 // Local is an object satisfying the Clock interface, which
64 // returns the current time in the local timezone
65 var Local = clockFn(time.Now)
67 // Option is used to pass optional arguments to
68 // the RotateLogs constructor
69 type Option interface {