move log level setting to option (#1222)

This commit is contained in:
Asim Aslam
2020-02-20 08:26:12 +00:00
committed by GitHub
parent c7eed618c2
commit 78df154a4d
2 changed files with 18 additions and 13 deletions

View File

@@ -17,5 +17,15 @@ import (
type Option func(*Options)
type Options struct {
// The Log Level
Level Level
// Other opts
Context context.Context
}
// WithLevel sets the log level
func WithLevel(l Level) Option {
return func(o *Options) {
o.Level = l
}
}