()
| 643 | } |
| 644 | |
| 645 | func ExampleContext_Times() { |
| 646 | t1 := time.Time{} |
| 647 | t2 := t1.Add(time.Second * 10) |
| 648 | t := []time.Time{t1, t2} |
| 649 | |
| 650 | log := zerolog.New(os.Stdout).With(). |
| 651 | Str("foo", "bar"). |
| 652 | Times("times", t). |
| 653 | Logger() |
| 654 | |
| 655 | log.Log().Msg("hello world") |
| 656 | |
| 657 | // Output: {"foo":"bar","times":["0001-01-01T00:00:00Z","0001-01-01T00:00:10Z"],"message":"hello world"} |
| 658 | } |
| 659 | |
| 660 | func ExampleEvent_Stringers() { |
| 661 | log := zerolog.New(os.Stdout) |