()
| 114 | } |
| 115 | |
| 116 | func ExampleLogger_Debug() { |
| 117 | dst := bytes.Buffer{} |
| 118 | log := New(&dst) |
| 119 | |
| 120 | log.Debug(). |
| 121 | Str("foo", "bar"). |
| 122 | Int("n", 123). |
| 123 | Msg("hello world") |
| 124 | |
| 125 | fmt.Println(decodeIfBinaryToString(dst.Bytes())) |
| 126 | // Output: {"level":"debug","foo":"bar","n":123,"message":"hello world"} |
| 127 | } |
| 128 | |
| 129 | func ExampleLogger_Info() { |
| 130 | dst := bytes.Buffer{} |