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

Method WithOptions

logger.go:169–175  ·  view source on GitHub ↗

WithOptions clones the current Logger, applies the supplied Options, and returns the resulting Logger. It's safe to use concurrently.

(opts ...Option)

Source from the content-addressed store, hash-verified

167// WithOptions clones the current Logger, applies the supplied Options, and
168// returns the resulting Logger. It's safe to use concurrently.
169func (log *Logger) WithOptions(opts ...Option) *Logger {
170 c := log.clone()
171 for _, opt := range opts {
172 opt.apply(c)
173 }
174 return c
175}
176
177// With creates a child logger and adds structured context to it. Fields added
178// to the child don't affect the parent, and vice versa. Any fields that

Callers 15

NewFunction · 0.95
WithLazyMethod · 0.95
NewStdLogFunction · 0.45
NewStdLogAtFunction · 0.45
redirectStdLogAtFunction · 0.45
TestGlobalsConcurrentUseFunction · 0.45
TestIncreaseLevelFunction · 0.45
NewExampleFunction · 0.45

Calls 2

cloneMethod · 0.95
applyMethod · 0.65