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

Function WrapCore

options.go:42–46  ·  view source on GitHub ↗

WrapCore wraps or replaces the Logger's underlying zapcore.Core.

(f func(zapcore.Core) zapcore.Core)

Source from the content-addressed store, hash-verified

40
41// WrapCore wraps or replaces the Logger's underlying zapcore.Core.
42func WrapCore(f func(zapcore.Core) zapcore.Core) Option {
43 return optionFunc(func(log *Logger) {
44 log.core = f(log.core)
45 })
46}
47
48// Hooks registers functions which will be called each time the Logger writes
49// out an Entry. Repeated use of Hooks is additive.

Callers 6

ExampleWrapCore_replaceFunction · 0.92
ExampleWrapCore_wrapFunction · 0.92
TestLoggerReplaceCoreFunction · 0.85
WithLazyMethod · 0.85
buildOptionsMethod · 0.85

Calls 1

optionFuncFuncType · 0.70

Tested by 4

ExampleWrapCore_replaceFunction · 0.74
ExampleWrapCore_wrapFunction · 0.74
TestLoggerReplaceCoreFunction · 0.68