Skip to content

Commit

Permalink
fix: call setupLogger after SetLogger (#145)
Browse files Browse the repository at this point in the history
  • Loading branch information
sanposhiho authored Oct 4, 2023
1 parent d7b8f45 commit 076f925
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ func main() {
opts.BindFlags(flag.CommandLine)
flag.Parse()

ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts)))

config, err := config.ParseConfig(configPath)
if err != nil {
setupLog.Error(err, "failed to load config")
Expand All @@ -94,8 +96,6 @@ func main() {

setupLog.Info("config", "config", *config)

ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts)))

mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Scheme: scheme,
MetricsBindAddress: metricsAddr,
Expand Down

0 comments on commit 076f925

Please sign in to comment.