Skip to content

Commit

Permalink
Merge pull request #2100 from crossplane-contrib/backport-2099-to-rel…
Browse files Browse the repository at this point in the history
…ease-0.49

[Backport release-0.49] fix: Explicitly provide no-op logger by default
  • Loading branch information
MisterMX authored Oct 9, 2024
2 parents cbe3158 + 1d25f55 commit f5d6120
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 f5d6120

Please sign in to comment.