From ad481b9ba1b00c05fe175ae62b0e80827fda9aa8 Mon Sep 17 00:00:00 2001 From: Clayton Walker Date: Mon, 10 Apr 2023 18:56:21 -0600 Subject: [PATCH] Simplify logging Signed-off-by: Clayton Walker --- cmd/kubectl-argo-rollouts/main.go | 6 ++---- cmd/rollouts-controller/main.go | 4 +--- utils/log/log.go | 4 +--- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/cmd/kubectl-argo-rollouts/main.go b/cmd/kubectl-argo-rollouts/main.go index 82696dc98f..b7d9a02d0a 100644 --- a/cmd/kubectl-argo-rollouts/main.go +++ b/cmd/kubectl-argo-rollouts/main.go @@ -4,9 +4,7 @@ import ( "os" logutil "github.com/argoproj/argo-rollouts/utils/log" - - "github.com/sirupsen/logrus" - + log "github.com/sirupsen/logrus" "k8s.io/cli-runtime/pkg/genericclioptions" _ "k8s.io/client-go/plugin/pkg/client/auth/azure" _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" @@ -19,7 +17,7 @@ import ( func main() { klog.InitFlags(nil) - logutil.SetKLogLogger(logrus.New()) + logutil.SetKLogLogger(log.New()) streams := genericclioptions.IOStreams{In: os.Stdin, Out: os.Stdout, ErrOut: os.Stderr} o := options.NewArgoRolloutsOptions(streams) root := cmd.NewCmdArgoRollouts(o) diff --git a/cmd/rollouts-controller/main.go b/cmd/rollouts-controller/main.go index 9984fc1009..bb3cfeba1a 100644 --- a/cmd/rollouts-controller/main.go +++ b/cmd/rollouts-controller/main.go @@ -6,8 +6,6 @@ import ( "strings" "time" - "github.com/sirupsen/logrus" - "github.com/argoproj/pkg/kubeclientmetrics" smiclientset "github.com/servicemeshinterface/smi-sdk-go/pkg/gen/client/split/clientset/versioned" log "github.com/sirupsen/logrus" @@ -85,7 +83,7 @@ func newCommand() *cobra.Command { if logFormat != "" { log.SetFormatter(createFormatter(logFormat)) } - logutil.SetKLogLogger(logrus.New()) + logutil.SetKLogLogger(log.New()) logutil.SetKLogLevel(klogLevel) log.WithField("version", version.GetVersion()).Info("Argo Rollouts starting") diff --git a/utils/log/log.go b/utils/log/log.go index edecc5e4d9..049f26f935 100644 --- a/utils/log/log.go +++ b/utils/log/log.go @@ -7,8 +7,6 @@ import ( "github.com/bombsimon/logrusr/v4" - "github.com/sirupsen/logrus" - log "github.com/sirupsen/logrus" "k8s.io/apimachinery/pkg/api/meta" "k8s.io/apimachinery/pkg/runtime" @@ -33,7 +31,7 @@ const ( ) // SetKLogLogger set the klog logger for the k8s go-client -func SetKLogLogger(logger *logrus.Logger) { +func SetKLogLogger(logger *log.Logger) { klog.SetLogger(logrusr.New(logger)) }