()
| 14 | ) |
| 15 | |
| 16 | func ExampleLogger_With() { |
| 17 | dst := bytes.Buffer{} |
| 18 | log := New(&dst). |
| 19 | With(). |
| 20 | Str("foo", "bar"). |
| 21 | Logger() |
| 22 | |
| 23 | log.Info().Msg("hello world") |
| 24 | fmt.Println(decodeIfBinaryToString(dst.Bytes())) |
| 25 | |
| 26 | // Output: {"level":"info","foo":"bar","message":"hello world"} |
| 27 | } |
| 28 | |
| 29 | func ExampleLogger_Level() { |
| 30 | dst := bytes.Buffer{} |