()
| 482 | } |
| 483 | |
| 484 | func ExampleContext_EmbedObject() { |
| 485 | price := Price{val: 6449, prec: 2, unit: "$"} |
| 486 | |
| 487 | dst := bytes.Buffer{} |
| 488 | log := New(&dst).With(). |
| 489 | Str("foo", "bar"). |
| 490 | EmbedObject(price). |
| 491 | Logger() |
| 492 | |
| 493 | log.Log().Msg("hello world") |
| 494 | |
| 495 | fmt.Println(decodeIfBinaryToString(dst.Bytes())) |
| 496 | // Output: {"foo":"bar","price":"$64.49","message":"hello world"} |
| 497 | } |
| 498 | func ExampleContext_Object() { |
| 499 | // User implements LogObjectMarshaler |
| 500 | u := User{"John", 35, time.Time{}} |
nothing calls this directly
no test coverage detected