()
| 332 | } |
| 333 | |
| 334 | func ExampleEvent_Interface() { |
| 335 | log := zerolog.New(os.Stdout) |
| 336 | |
| 337 | obj := struct { |
| 338 | Name string `json:"name"` |
| 339 | }{ |
| 340 | Name: "john", |
| 341 | } |
| 342 | |
| 343 | log.Log(). |
| 344 | Str("foo", "bar"). |
| 345 | Interface("obj", obj). |
| 346 | Msg("hello world") |
| 347 | |
| 348 | // Output: {"foo":"bar","obj":{"name":"john"},"message":"hello world"} |
| 349 | } |
| 350 | |
| 351 | func ExampleEvent_Dur() { |
| 352 | d := 10 * time.Second |