Skip to content

Commit

Permalink
utc timestamps (#12)
Browse files Browse the repository at this point in the history
Co-authored-by: trimble <trimble@tartu.boxworld.com>
  • Loading branch information
clarktrimble and trimble authored Nov 15, 2023
1 parent 31535a7 commit 8a5e577
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sabot.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ const (

func (sabot *Sabot) log(ctx context.Context, level, msg string, kv []any) {

now := time.Now().UTC()

ctxFields := sabot.GetFields(ctx)
fields := newFields(kv)

Expand All @@ -75,7 +77,7 @@ func (sabot *Sabot) log(ctx context.Context, level, msg string, kv []any) {

fields["msg"] = msg
fields["level"] = level
fields["ts"] = time.Now()
fields["ts"] = now

fields.truncate(sabot.MaxLen)

Expand Down

0 comments on commit 8a5e577

Please sign in to comment.