logger: add WithContext option
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user