Co-authored-by: Gorbunov Kirill Andreevich <kgorbunov@mtsbank.ru> Reviewed-on: #338 Co-authored-by: Кирилл Горбунов <kirya_gorbunov_2015@mail.ru> Co-committed-by: Кирилл Горбунов <kirya_gorbunov_2015@mail.ru>
This commit is contained in:
parent
b8928d3da9
commit
725ed992cc
@ -214,6 +214,20 @@ func WithMicroKeys() options.Option {
|
||||
}
|
||||
}
|
||||
|
||||
// WithAddCallerSkipCount add skip count for copy logger
|
||||
func WithAddCallerSkipCount(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
|
||||
}
|
||||
}
|
||||
|
||||
// WithAddStacktrace controls writing stacktrace on error
|
||||
func WithAddStacktrace(v bool) options.Option {
|
||||
return func(src interface{}) error {
|
||||
|
Loading…
Reference in New Issue
Block a user