()
| 164 | } |
| 165 | |
| 166 | func ExampleLogger_WithLevel() { |
| 167 | dst := bytes.Buffer{} |
| 168 | log := New(&dst) |
| 169 | |
| 170 | log.WithLevel(InfoLevel). |
| 171 | Msg("hello world") |
| 172 | |
| 173 | fmt.Println(decodeIfBinaryToString(dst.Bytes())) |
| 174 | // Output: {"level":"info","message":"hello world"} |
| 175 | } |
| 176 | |
| 177 | func ExampleLogger_Write() { |
| 178 | dst := bytes.Buffer{} |