Skip to content

Commit

Permalink
Simplify logging
Browse files Browse the repository at this point in the history
Signed-off-by: Clayton Walker <[email protected]>
  • Loading branch information
Sineaggi committed Apr 11, 2023
1 parent 38d0352 commit ad481b9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
6 changes: 2 additions & 4 deletions cmd/kubectl-argo-rollouts/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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)
Expand Down
4 changes: 1 addition & 3 deletions cmd/rollouts-controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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")

Expand Down
4 changes: 1 addition & 3 deletions utils/log/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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))
}

Expand Down

0 comments on commit ad481b9

Please sign in to comment.