diff --git a/handler.go b/handler.go index c4c155b..9344af0 100644 --- a/handler.go +++ b/handler.go @@ -17,7 +17,7 @@ import ( const ( // DefaultTimeFormat is the default format for any [time.Time] logged. - DefaultTimeFormat = "2006-01-02T15:04:05,000Z07:00" + DefaultTimeFormat = "2006-01-02T15:04:05,999Z07:00" ) var ( diff --git a/handler_test.go b/handler_test.go index 3fe7db0..298dd69 100644 --- a/handler_test.go +++ b/handler_test.go @@ -42,7 +42,7 @@ func TestHandler(t *testing.T) { slog.Int("int", -123_456), slog.Int64("int64", 42), slog.String("string", "a string"), - slog.Time("time", time.Date(2000, 1, 2, 3, 4, 5, 6, time.UTC)), + slog.Time("time", time.Date(2000, 1, 2, 3, 4, 5, 6, time.UTC).Add(123_456*time.Microsecond)), slog.Uint64("uint64", 123456), }, Patterns: []string{ @@ -57,7 +57,7 @@ func TestHandler(t *testing.T) { `\sint=-123,456\b`, `\sline=\d+\b\b`, `\sstring=a string\b`, - `\stime=2000-01-02T03:04:05,000Z\b`, + `\stime=2000-01-02T03:04:05,123Z\b`, `\suint64=123,456\b`, }, },