(t *testing.T)
| 279 | } |
| 280 | |
| 281 | func TestWithTimeShouldNotOverrideFields(t *testing.T) { |
| 282 | now := time.Now().Add(24 * time.Hour) |
| 283 | |
| 284 | LogAndAssertJSON(t, func(log *Logger) { |
| 285 | log.WithField("herp", "derp").WithTime(now).Info("blah") |
| 286 | }, func(fields Fields) { |
| 287 | assert.Equal(t, now.Format(time.RFC3339), fields["time"]) |
| 288 | assert.Equal(t, "derp", fields["herp"]) |
| 289 | }) |
| 290 | } |
| 291 | |
| 292 | func TestWithFieldShouldNotOverrideTime(t *testing.T) { |
| 293 | now := time.Now().Add(24 * time.Hour) |