()
| 510 | } |
| 511 | |
| 512 | func ExampleContext_Interface() { |
| 513 | obj := struct { |
| 514 | Name string `json:"name"` |
| 515 | }{ |
| 516 | Name: "john", |
| 517 | } |
| 518 | |
| 519 | log := zerolog.New(os.Stdout).With(). |
| 520 | Str("foo", "bar"). |
| 521 | Interface("obj", obj). |
| 522 | Logger() |
| 523 | |
| 524 | log.Log().Msg("hello world") |
| 525 | |
| 526 | // Output: {"foo":"bar","obj":{"name":"john"},"message":"hello world"} |
| 527 | } |
| 528 | |
| 529 | func ExampleContext_Dur() { |
| 530 | d := 10 * time.Second |