()
| 175 | } |
| 176 | |
| 177 | func ExampleLogger_Write() { |
| 178 | dst := bytes.Buffer{} |
| 179 | log := New(&dst).With(). |
| 180 | Str("foo", "bar"). |
| 181 | Logger() |
| 182 | |
| 183 | stdlog.SetFlags(0) |
| 184 | stdlog.SetOutput(log) |
| 185 | |
| 186 | stdlog.Print("hello world") |
| 187 | |
| 188 | fmt.Println(decodeIfBinaryToString(dst.Bytes())) |
| 189 | // Output: {"foo":"bar","message":"hello world"} |
| 190 | } |
| 191 | |
| 192 | func ExampleLogger_Log() { |
| 193 | dst := bytes.Buffer{} |