()
| 346 | } |
| 347 | |
| 348 | func ExampleEvent_Dur() { |
| 349 | d := time.Duration(10 * time.Second) |
| 350 | |
| 351 | dst := bytes.Buffer{} |
| 352 | log := New(&dst) |
| 353 | |
| 354 | log.Log(). |
| 355 | Str("foo", "bar"). |
| 356 | Dur("dur", d). |
| 357 | Msg("hello world") |
| 358 | |
| 359 | fmt.Println(decodeIfBinaryToString(dst.Bytes())) |
| 360 | // Output: {"foo":"bar","dur":10000,"message":"hello world"} |
| 361 | } |
| 362 | |
| 363 | func ExampleEvent_Durs() { |
| 364 | d := []time.Duration{ |