logger: add WithContext option
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
6dc7e792c8
commit
37f7960f4a
@ -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 {
|
||||
return func(o *Options) {
|
||||
if o.Context == nil {
|
||||
|
Loading…
Reference in New Issue
Block a user