chore: Change log ts format to RFC3339 (#1191)

The TimeEncoder for zap seems to have been set to EpochTimeEncoder which is the default and it was not very readable. Changing it to a TimeEncoderOfLayout(time.RFC3339) for readability.

Another benefit of doing this is the ts format is now consistent with various timestamps ARC put into pod and other custom resource annotations.
This commit is contained in:
Yusuke Kuoka
2022-03-08 10:34:52 +09:00
committed by GitHub
parent 15ee6d6360
commit 301439b06a

View File

@@ -4,6 +4,7 @@ import (
"fmt"
"os"
"strconv"
"time"
"github.com/go-logr/logr"
zaplib "go.uber.org/zap"
@@ -48,6 +49,7 @@ func NewLogger(logLevel string) logr.Logger {
atomicLevel := zaplib.NewAtomicLevelAt(level)
o.Level = &atomicLevel
}
o.TimeEncoder = zapcore.TimeEncoderOfLayout(time.RFC3339)
})
return log