AddCallerSkip increases the number of callers skipped by caller annotation (as enabled by the AddCaller option). When building wrappers around the Logger and SugaredLogger, supplying this Option prevents zap from always reporting the wrapper code as the caller.
(skip int)
| 106 | // Logger and SugaredLogger, supplying this Option prevents zap from always |
| 107 | // reporting the wrapper code as the caller. |
| 108 | func AddCallerSkip(skip int) Option { |
| 109 | return optionFunc(func(log *Logger) { |
| 110 | log.callerSkip += skip |
| 111 | }) |
| 112 | } |
| 113 | |
| 114 | // AddStacktrace configures the Logger to record a stack trace for all messages at |
| 115 | // or above a given level. |