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

Function ExampleDict

example_test.go:362–373  ·  example_test.go::ExampleDict
()

Source from the content-addressed store, hash-verified

360}
361
362func ExampleDict() {
363 logger := zap.NewExample()
364 defer logger.Sync()
365
366 logger.Info("login event",
367 zap.Dict("event",
368 zap.Int("id", 123),
369 zap.String("name", "jane"),
370 zap.String("status", "pending")))
371 // Output:
372 // {"level":"info","msg":"login event","event":{"id":123,"name":"jane","status":"pending"}}
373}
374
375func ExampleObjects() {
376 logger := zap.NewExample()

Callers

nothing calls this directly

Calls 6

NewExampleFunction · 0.92
DictFunction · 0.92
IntFunction · 0.92
StringFunction · 0.92
SyncMethod · 0.65
InfoMethod · 0.45

Tested by

no test coverage detected