Skip to content

Commit

Permalink
less change
Browse files Browse the repository at this point in the history
  • Loading branch information
erikgb committed Sep 3, 2024
1 parent a86581c commit 123b2f9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/zap/zap.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,13 @@ func stringToLevelEnablerHookFunc() mapstructure.DecodeHookFuncType {
sVal := val.(string)
if sVal == "" {
var v zapcore.LevelEnabler
// return nil if logLevel is not set; controller-runtime sets the default value
// return nil if level is not set; controller-runtime sets the default value
return &v, nil
}

var logLevel zap.AtomicLevel
if err := logLevel.UnmarshalText([]byte(sVal)); err != nil {
// Level string not successfully parsed as a valid zap level string. Trying to parse int level.
iVal, err := strconv.Atoi(sVal)
if err != nil {
return nil, fmt.Errorf("invalid log logLevel \"%s\"", val)
Expand Down

0 comments on commit 123b2f9

Please sign in to comment.