Skip to content

Commit

Permalink
fix linter
Browse files Browse the repository at this point in the history
Signed-off-by: ShutingZhao <shuting@nirmata.com>
realshuting committed Nov 16, 2023
1 parent 148c44a commit 4b8d24d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pkg/logging/log.go
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ import (
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"k8s.io/klog/v2"
"k8s.io/klog/v2/klogr"
"k8s.io/klog/v2/textlogger"
"sigs.k8s.io/controller-runtime/pkg/log"
)

@@ -49,8 +49,11 @@ func InitFlags(flags *flag.FlagSet) {
func Setup(logFormat string, level int) error {
switch logFormat {
case TextFormat:
// in text mode we use FormatSerialize format
globalLog = klogr.New()
config := textlogger.NewConfig(
textlogger.Verbosity(2),
textlogger.Output(os.Stdout),
)
globalLog = textlogger.NewLogger(config)
case JSONFormat:
zc := zap.NewProductionConfig()
// Zap's levels get more and less verbose as the number gets smaller and higher respectively (DebugLevel is -1, InfoLevel is 0, WarnLevel is 1, and so on).

0 comments on commit 4b8d24d

Please sign in to comment.