From 076f92539d0c227543c5c499a9d337907d6ea73f Mon Sep 17 00:00:00 2001 From: Kensei Nakada Date: Wed, 4 Oct 2023 15:59:52 +0900 Subject: [PATCH] fix: call setupLogger after SetLogger (#145) --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 4f34a5b2..6b6a921b 100644 --- a/main.go +++ b/main.go @@ -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") @@ -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,