(t *testing.T)
| 205 | } |
| 206 | |
| 207 | func TestJSONEntryEndsWithNewline(t *testing.T) { |
| 208 | formatter := &JSONFormatter{} |
| 209 | |
| 210 | b, err := formatter.Format(WithField("level", "something")) |
| 211 | if err != nil { |
| 212 | t.Fatal("Unable to format entry: ", err) |
| 213 | } |
| 214 | |
| 215 | if b[len(b)-1] != '\n' { |
| 216 | t.Fatal("Expected JSON log entry to end with a newline") |
| 217 | } |
| 218 | } |
| 219 | |
| 220 | func TestJSONMessageKey(t *testing.T) { |
| 221 | formatter := &JSONFormatter{ |