Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkg/log/zap/zap.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ type Options struct {
// underlying Zap logger.
ZapOpts []zap.Option
// TimeEncoder specifies the encoder for the timestamps in log messages.
// Defaults to EpochTimeEncoder as this is the default in Zap currently.
// Defaults to RFC3339TimeEncoder.
TimeEncoder zapcore.TimeEncoder
}

Expand Down Expand Up @@ -217,7 +217,7 @@ func (o *Options) addDefaults() {
}

if o.TimeEncoder == nil {
o.TimeEncoder = zapcore.EpochTimeEncoder
o.TimeEncoder = zapcore.RFC3339TimeEncoder
}
f := func(ecfg *zapcore.EncoderConfig) {
ecfg.EncodeTime = o.TimeEncoder
Expand Down
4 changes: 2 additions & 2 deletions pkg/log/zap/zap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ var _ = Describe("Zap log level flag options setup", func() {
Expect(optVal.Pointer()).To(Equal(expVal.Pointer()))
})

It("Should default to 'epoch' time encoding", func() {
It("Should default to 'rfc3339' time encoding", func() {
args := []string{""}
fromFlags.BindFlags(&fs)
err := fs.Parse(args)
Expand All @@ -513,7 +513,7 @@ var _ = Describe("Zap log level flag options setup", func() {
opt.addDefaults()

optVal := reflect.ValueOf(opt.TimeEncoder)
expVal := reflect.ValueOf(zapcore.EpochTimeEncoder)
expVal := reflect.ValueOf(zapcore.RFC3339TimeEncoder)

Expect(optVal.Pointer()).To(Equal(expVal.Pointer()))
})
Expand Down