Skip to content

Commit 3207980

Browse files
committed
Fix bug
Make zerolog use `RFC3339Nano` as the time field format.
1 parent 517586b commit 3207980

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

zerolog/zerolog.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,16 @@ package zerolog
22

33
import (
44
"io"
5+
"time"
56

67
"github.com/globusdigital/logbench/benchmark"
78
"github.com/rs/zerolog"
89
)
910

11+
func init() {
12+
zerolog.TimeFieldFormat = time.RFC3339Nano
13+
}
14+
1015
func newLogger(out io.ReadWriter) zerolog.Logger {
1116
// Initialize logger
1217
return zerolog.New(out).With().Timestamp().Logger()

0 commit comments

Comments
 (0)