()
| 531 | } |
| 532 | |
| 533 | func ExampleContext_Dur() { |
| 534 | d := time.Duration(10 * time.Second) |
| 535 | |
| 536 | dst := bytes.Buffer{} |
| 537 | log := New(&dst).With(). |
| 538 | Str("foo", "bar"). |
| 539 | Dur("dur", d). |
| 540 | Logger() |
| 541 | |
| 542 | log.Log().Msg("hello world") |
| 543 | |
| 544 | fmt.Println(decodeIfBinaryToString(dst.Bytes())) |
| 545 | // Output: {"foo":"bar","dur":10000,"message":"hello world"} |
| 546 | } |
| 547 | |
| 548 | func ExampleContext_Durs() { |
| 549 | d := []time.Duration{ |