()
| 415 | } |
| 416 | |
| 417 | func ExampleContext_Dict() { |
| 418 | dst := bytes.Buffer{} |
| 419 | ctx := New(&dst).With(). |
| 420 | Str("foo", "bar") |
| 421 | |
| 422 | logger := ctx.Dict("dict", ctx.CreateDict(). |
| 423 | Str("bar", "baz"). |
| 424 | Int("n", 1), |
| 425 | ).Logger() |
| 426 | |
| 427 | logger.Log().Msg("hello world") |
| 428 | |
| 429 | fmt.Println(decodeIfBinaryToString(dst.Bytes())) |
| 430 | // Output: {"foo":"bar","dict":{"bar":"baz","n":1},"message":"hello world"} |
| 431 | } |
| 432 | |
| 433 | func ExampleContext_Array() { |
| 434 | dst := bytes.Buffer{} |
nothing calls this directly
no test coverage detected
searching dependent graphs…