()
| 431 | } |
| 432 | |
| 433 | func ExampleContext_Array() { |
| 434 | dst := bytes.Buffer{} |
| 435 | ctx := New(&dst).With(). |
| 436 | Str("foo", "bar") |
| 437 | |
| 438 | logger := ctx.Array("array", ctx.CreateArray(). |
| 439 | Str("baz"). |
| 440 | Int(1), |
| 441 | ).Logger() |
| 442 | |
| 443 | logger.Log().Msg("hello world") |
| 444 | |
| 445 | fmt.Println(decodeIfBinaryToString(dst.Bytes())) |
| 446 | // Output: {"foo":"bar","array":["baz",1],"message":"hello world"} |
| 447 | } |
| 448 | |
| 449 | func ExampleContext_Array_object() { |
| 450 | // Users implements LogArrayMarshaler |
nothing calls this directly
no test coverage detected