Added debug.Logger interface

This commit is contained in:
Milos Gajdos
2019-11-27 16:02:16 +00:00
parent 3f7f2afc7b
commit ee9776e7b2
5 changed files with 278 additions and 7 deletions

24
debug/log/options.go Normal file
View File

@@ -0,0 +1,24 @@
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,
}
}