MCPcopy
hub / github.com/uber-go/zap / AddCallerSkip

Function AddCallerSkip

options.go:108–112  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

106// Logger and SugaredLogger, supplying this Option prevents zap from always
107// reporting the wrapper code as the caller.
108func 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.

Callers 9

NewStdLogFunction · 0.85
NewStdLogAtFunction · 0.85
redirectStdLogAtFunction · 0.85
TestSugarAddCallerFunction · 0.85
TestSugarAddCallerFailFunction · 0.85
TestLoggerAddCallerFunction · 0.85
TestLoggerAddCallerFailFunction · 0.85

Calls 1

optionFuncFuncType · 0.70

Tested by 6

TestSugarAddCallerFunction · 0.68
TestSugarAddCallerFailFunction · 0.68
TestLoggerAddCallerFunction · 0.68
TestLoggerAddCallerFailFunction · 0.68