(t *testing.T)
| 318 | } |
| 319 | |
| 320 | func TestJSONDisableTimestamp(t *testing.T) { |
| 321 | formatter := &JSONFormatter{ |
| 322 | DisableTimestamp: true, |
| 323 | } |
| 324 | |
| 325 | b, err := formatter.Format(WithField("level", "something")) |
| 326 | if err != nil { |
| 327 | t.Fatal("Unable to format entry: ", err) |
| 328 | } |
| 329 | s := string(b) |
| 330 | if strings.Contains(s, FieldKeyTime) { |
| 331 | t.Error("Did not prevent timestamp", s) |
| 332 | } |
| 333 | } |
| 334 | |
| 335 | func TestJSONEnableTimestamp(t *testing.T) { |
| 336 | formatter := &JSONFormatter{} |