diff --git a/logger/options.go b/logger/options.go index c0335316..3018121f 100644 --- a/logger/options.go +++ b/logger/options.go @@ -176,3 +176,16 @@ func WithMicroKeys() options.Option { return nil } } + +func WithIncCallerSkipCount(n int) options.Option { + return func(src interface{}) error { + c, err := options.Get(src, ".CallerSkipCount") + if err != nil { + return err + } + if err = options.Set(src, c.(int)+n, ".CallerSkipCount"); err != nil { + return err + } + return nil + } +}