()
| 410 | } |
| 411 | |
| 412 | func ExampleContext_Dict() { |
| 413 | ctx := zerolog.New(os.Stdout).With(). |
| 414 | Str("foo", "bar") |
| 415 | |
| 416 | logger := ctx.Dict("dict", ctx.CreateDict(). |
| 417 | Str("bar", "baz"). |
| 418 | Int("n", 1), |
| 419 | ).Logger() |
| 420 | |
| 421 | logger.Log().Msg("hello world") |
| 422 | |
| 423 | // Output: {"foo":"bar","dict":{"bar":"baz","n":1},"message":"hello world"} |
| 424 | } |
| 425 | |
| 426 | func ExampleContext_Array() { |
| 427 | ctx := zerolog.New(os.Stdout).With(). |