()
| 540 | } |
| 541 | |
| 542 | func ExampleContext_Durs() { |
| 543 | d := []time.Duration{ |
| 544 | 10 * time.Second, |
| 545 | 20 * time.Second, |
| 546 | } |
| 547 | |
| 548 | log := zerolog.New(os.Stdout).With(). |
| 549 | Str("foo", "bar"). |
| 550 | Durs("durs", d). |
| 551 | Logger() |
| 552 | |
| 553 | log.Log().Msg("hello world") |
| 554 | |
| 555 | // Output: {"foo":"bar","durs":[10000,20000],"message":"hello world"} |
| 556 | } |
| 557 | |
| 558 | func ExampleContext_IPAddr() { |
| 559 | hostIP := net.IP{192, 168, 0, 100} |