()
| 373 | } |
| 374 | |
| 375 | func ExampleObjects() { |
| 376 | logger := zap.NewExample() |
| 377 | defer logger.Sync() |
| 378 | |
| 379 | // Use the Objects field constructor when you have a list of objects, |
| 380 | // all of which implement zapcore.ObjectMarshaler. |
| 381 | logger.Debug("opening connections", |
| 382 | zap.Objects("addrs", []addr{ |
| 383 | {IP: "123.45.67.89", Port: 4040}, |
| 384 | {IP: "127.0.0.1", Port: 4041}, |
| 385 | {IP: "192.168.0.1", Port: 4042}, |
| 386 | })) |
| 387 | // Output: |
| 388 | // {"level":"debug","msg":"opening connections","addrs":[{"ip":"123.45.67.89","port":4040},{"ip":"127.0.0.1","port":4041},{"ip":"192.168.0.1","port":4042}]} |
| 389 | } |
| 390 | |
| 391 | func ExampleDictObject() { |
| 392 | logger := zap.NewExample() |
nothing calls this directly
no test coverage detected