()
| 378 | } |
| 379 | |
| 380 | func ExampleEvent_Fields_map() { |
| 381 | fields := map[string]interface{}{ |
| 382 | "bar": "baz", |
| 383 | "n": 1, |
| 384 | } |
| 385 | |
| 386 | log := zerolog.New(os.Stdout) |
| 387 | |
| 388 | log.Log(). |
| 389 | Str("foo", "bar"). |
| 390 | Fields(fields). |
| 391 | Msg("hello world") |
| 392 | |
| 393 | // Output: {"foo":"bar","bar":"baz","n":1,"message":"hello world"} |
| 394 | } |
| 395 | |
| 396 | func ExampleEvent_Fields_slice() { |
| 397 | fields := []interface{}{ |