Add log Format option
This commit is contained in:
@@ -11,6 +11,8 @@ type Options struct {
|
||||
Name string
|
||||
// Size is the size of ring buffer
|
||||
Size int
|
||||
// Format specifies the output format
|
||||
Format FormatFunc
|
||||
}
|
||||
|
||||
// Name of the log
|
||||
@@ -27,6 +29,12 @@ func Size(s int) Option {
|
||||
}
|
||||
}
|
||||
|
||||
func Format(f FormatFunc) Option {
|
||||
return func(o *Options) {
|
||||
o.Format = f
|
||||
}
|
||||
}
|
||||
|
||||
// DefaultOptions returns default options
|
||||
func DefaultOptions() Options {
|
||||
return Options{
|
||||
|
Reference in New Issue
Block a user