Add log Format option

This commit is contained in:
Asim Aslam
2019-12-19 12:20:33 +00:00
parent d52a111735
commit 2bcfb85613
3 changed files with 26 additions and 3 deletions

View File

@@ -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{