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

Function ExampleReplaceGlobals

example_test.go:226–236  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

224}
225
226func ExampleReplaceGlobals() {
227 logger := zap.NewExample()
228 defer logger.Sync()
229
230 undo := zap.ReplaceGlobals(logger)
231 defer undo()
232
233 zap.L().Info("replaced zap's global loggers")
234 // Output:
235 // {"level":"info","msg":"replaced zap's global loggers"}
236}
237
238func ExampleAtomicLevel() {
239 atom := zap.NewAtomicLevel()

Callers

nothing calls this directly

Calls 5

NewExampleFunction · 0.92
ReplaceGlobalsFunction · 0.92
LFunction · 0.92
SyncMethod · 0.65
InfoMethod · 0.45

Tested by

no test coverage detected