()
| 127 | } |
| 128 | |
| 129 | func ExampleLogger_Info() { |
| 130 | dst := bytes.Buffer{} |
| 131 | log := New(&dst) |
| 132 | |
| 133 | log.Info(). |
| 134 | Str("foo", "bar"). |
| 135 | Int("n", 123). |
| 136 | Msg("hello world") |
| 137 | |
| 138 | fmt.Println(decodeIfBinaryToString(dst.Bytes())) |
| 139 | // Output: {"level":"info","foo":"bar","n":123,"message":"hello world"} |
| 140 | } |
| 141 | |
| 142 | func ExampleLogger_Warn() { |
| 143 | dst := bytes.Buffer{} |