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

Function WithCaller

options.go:98–102  ·  view source on GitHub ↗

WithCaller configures the Logger to annotate each message with the filename, line number, and function name of zap's caller, or not, depending on the value of enabled. This is a generalized form of AddCaller.

(enabled bool)

Source from the content-addressed store, hash-verified

96// line number, and function name of zap's caller, or not, depending on the
97// value of enabled. This is a generalized form of AddCaller.
98func WithCaller(enabled bool) Option {
99 return optionFunc(func(log *Logger) {
100 log.addCaller = enabled
101 })
102}
103
104// AddCallerSkip increases the number of callers skipped by caller annotation
105// (as enabled by the AddCaller option). When building wrappers around the

Callers 3

AddCallerFunction · 0.70
TestLoggerAddCallerFunction · 0.70

Calls 1

optionFuncFuncType · 0.70

Tested by 2

TestLoggerAddCallerFunction · 0.56