()
| 424 | } |
| 425 | |
| 426 | func ExampleContext_Array() { |
| 427 | ctx := zerolog.New(os.Stdout).With(). |
| 428 | Str("foo", "bar") |
| 429 | |
| 430 | logger := ctx.Array("array", ctx.CreateArray(). |
| 431 | Str("baz"). |
| 432 | Int(1), |
| 433 | ).Logger() |
| 434 | |
| 435 | logger.Log().Msg("hello world") |
| 436 | |
| 437 | // Output: {"foo":"bar","array":["baz",1],"message":"hello world"} |
| 438 | } |
| 439 | |
| 440 | func ExampleContext_Array_object() { |
| 441 | // Users implements zerolog.LogArrayMarshaler |