(t *testing.T)
| 218 | } |
| 219 | |
| 220 | func TestJSONMessageKey(t *testing.T) { |
| 221 | formatter := &JSONFormatter{ |
| 222 | FieldMap: FieldMap{ |
| 223 | FieldKeyMsg: "message", |
| 224 | }, |
| 225 | } |
| 226 | |
| 227 | b, err := formatter.Format(&Entry{Message: "oh hai"}) |
| 228 | if err != nil { |
| 229 | t.Fatal("Unable to format entry: ", err) |
| 230 | } |
| 231 | s := string(b) |
| 232 | if !(strings.Contains(s, "message") && strings.Contains(s, "oh hai")) { |
| 233 | t.Fatal("Expected JSON to format message key") |
| 234 | } |
| 235 | } |
| 236 | |
| 237 | func TestJSONLevelKey(t *testing.T) { |
| 238 | formatter := &JSONFormatter{ |