()
| 611 | } |
| 612 | |
| 613 | func ExampleContext_Fields_map() { |
| 614 | fields := map[string]interface{}{ |
| 615 | "bar": "baz", |
| 616 | "n": 1, |
| 617 | } |
| 618 | |
| 619 | log := zerolog.New(os.Stdout).With(). |
| 620 | Str("foo", "bar"). |
| 621 | Fields(fields). |
| 622 | Logger() |
| 623 | |
| 624 | log.Log().Msg("hello world") |
| 625 | |
| 626 | // Output: {"foo":"bar","bar":"baz","n":1,"message":"hello world"} |
| 627 | } |
| 628 | |
| 629 | func ExampleContext_Fields_slice() { |
| 630 | fields := []interface{}{ |