micro/debug/log/options.go
2019-12-01 13:16:43 +00:00

25 lines
401 B
Go

package log
// Option used by the logger
type Option func(*Options)
// Options are logger options
type Options struct {
// Size is the size of ring buffer
Size int
}
// Size sets the size of the ring buffer
func Size(s int) Option {
return func(o *Options) {
o.Size = s
}
}
// DefaultOptions returns default options
func DefaultOptions() Options {
return Options{
Size: DefaultSize,
}
}