Skip to content

Commit

Permalink
logger: skip Debug logger call if debug is disabled (#1090)
Browse files Browse the repository at this point in the history
  • Loading branch information
cristiangreco authored Aug 3, 2023
1 parent ba183dd commit f4807b0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/logging/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,11 @@ func NewNopLogger() Logger {
}

func (g gokitLogger) Debug(message string, keyvals ...interface{}) {
kv := []interface{}{"msg", message}
kv = append(kv, keyvals...)
level.Debug(g.logger).Log(kv...)
if g.debugEnabled {
kv := []interface{}{"msg", message}
kv = append(kv, keyvals...)
level.Debug(g.logger).Log(kv...)
}
}

func (g gokitLogger) Info(message string, keyvals ...interface{}) {
Expand Down

0 comments on commit f4807b0

Please sign in to comment.