logger: add WithContext option

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2020-11-13 14:50:29 +03:00
parent 6dc7e792c8
commit 37f7960f4a

View File

@ -63,6 +63,13 @@ func WithCallerSkipCount(c int) Option {
} }
} }
// WithContext set context
func WithContext(ctx context.Context) Option {
return func(args *Options) {
args.Context = ctx
}
}
func SetOption(k, v interface{}) Option { func SetOption(k, v interface{}) Option {
return func(o *Options) { return func(o *Options) {
if o.Context == nil { if o.Context == nil {