()
| 361 | } |
| 362 | |
| 363 | func ExampleEvent_Durs() { |
| 364 | d := []time.Duration{ |
| 365 | time.Duration(10 * time.Second), |
| 366 | time.Duration(20 * time.Second), |
| 367 | } |
| 368 | |
| 369 | dst := bytes.Buffer{} |
| 370 | log := New(&dst) |
| 371 | |
| 372 | log.Log(). |
| 373 | Str("foo", "bar"). |
| 374 | Durs("durs", d). |
| 375 | Msg("hello world") |
| 376 | |
| 377 | fmt.Println(decodeIfBinaryToString(dst.Bytes())) |
| 378 | // Output: {"foo":"bar","durs":[10000,20000],"message":"hello world"} |
| 379 | } |
| 380 | |
| 381 | func ExampleEvent_Fields_map() { |
| 382 | fields := map[string]interface{}{ |