Skip to content

Commit

Permalink
added comment explaining ignore error
Browse files Browse the repository at this point in the history
  • Loading branch information
pavankrish123 committed Dec 5, 2021
1 parent 7e625e1 commit c2f49c0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions service/internal/telemetrylogs/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ func NewColGRPCLogger(baseLogger *zap.Logger, loglevel zapcore.Level) SettableGR
logger := baseLogger.WithOptions(zap.WrapCore(func(core zapcore.Core) zapcore.Core {
var c zapcore.Core
if loglevel == zap.InfoLevel {
// NewIncreaseLevelCore errors only if the new log level is less than the initial core level.
// In this case it never happens as WARN is always greater than INFO, therefore ignoring it.
c, _ = zapcore.NewIncreaseLevelCore(core, zap.WarnLevel)
} else {
c = core
Expand Down

0 comments on commit c2f49c0

Please sign in to comment.