Skip to content

Commit

Permalink
Merge pull request #2099 from simwak/fix/default-no-op-logger
Browse files Browse the repository at this point in the history
fix: Explicitly provide no-op logger by default
  • Loading branch information
MisterMX authored Oct 4, 2024
2 parents b94bc2b + 09d2e6e commit e36fb00
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/provider/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package main

import (
"context"
"io"
"os"
"path/filepath"
"time"
Expand Down Expand Up @@ -66,6 +67,9 @@ func main() {
// *very* verbose even at info level, so we only provide it a real
// logger when we're running in debug mode.
ctrl.SetLogger(zl)
} else {
// explicitly provide a no-op logger by default, otherwise controller-runtime gives a warning
ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard)))
}

log.Debug("Starting", "sync-period", syncInterval.String())
Expand Down

0 comments on commit e36fb00

Please sign in to comment.