Skip to content

Commit

Permalink
Setting the logger to fix runtime warning
Browse files Browse the repository at this point in the history
Signed-off-by: Alex <[email protected]>
  • Loading branch information
alex0chan committed Jan 30, 2025
1 parent 437bec0 commit acfd48e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/provider/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package main

import (
"context"
"io"
"os"
"path/filepath"
"time"
Expand Down Expand Up @@ -68,6 +69,10 @@ 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 {
// In non debug mode, setting the logger to no-op to fix the runtime warning which says
// log.SetLogger(...) was never called
ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard)))
}

log.Debug("Starting", "sync-period", syncPeriod.String(), "poll-interval", pollInterval.String(), "max-reconcile-rate", *maxReconcileRate)
Expand Down

0 comments on commit acfd48e

Please sign in to comment.