Skip to content

Commit

Permalink
fix(writer): disable ts key in writer (#51)
Browse files Browse the repository at this point in the history
* fix(writer): disable `ts` key in writer
to prevent multiple key being printed in same logline

Signed-off-by: Dwi Siswanto <[email protected]>

* feat(logger): change `log.TimestampKey` to `ts`

Signed-off-by: Dwi Siswanto <[email protected]>

---------

Signed-off-by: Dwi Siswanto <[email protected]>
  • Loading branch information
dwisiswant0 authored Jan 20, 2024
1 parent 39fe637 commit 8d6397e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 2 additions & 0 deletions internal/logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,7 @@ func New() *log.Logger {

logger.SetStyles(styles)

log.TimestampKey = "ts"

return logger
}
2 changes: 0 additions & 2 deletions internal/writer/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ func (w *logWriter) Write(p []byte) (n int, err error) {
return 0, err
}

w.Logger = w.With("ts", d["ts"])

err = w.write(d)

return
Expand Down

0 comments on commit 8d6397e

Please sign in to comment.