(t *testing.T)
| 333 | } |
| 334 | |
| 335 | func TestJSONEnableTimestamp(t *testing.T) { |
| 336 | formatter := &JSONFormatter{} |
| 337 | |
| 338 | b, err := formatter.Format(WithField("level", "something")) |
| 339 | if err != nil { |
| 340 | t.Fatal("Unable to format entry: ", err) |
| 341 | } |
| 342 | s := string(b) |
| 343 | if !strings.Contains(s, FieldKeyTime) { |
| 344 | t.Error("Timestamp not present", s) |
| 345 | } |
| 346 | } |
| 347 | |
| 348 | func TestJSONDisableHTMLEscape(t *testing.T) { |
| 349 | formatter := &JSONFormatter{DisableHTMLEscape: true} |