Skip to content

Commit

Permalink
fix: enable logging for the controller runtime
Browse files Browse the repository at this point in the history
Signed-off-by: fsl <1171313930@qq.com>
  • Loading branch information
fengshunli committed Jul 22, 2024
1 parent 64b76f2 commit 020cb1d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ import (
"github.com/argoproj/pkg/stats"
"k8s.io/apimachinery/pkg/runtime"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/log/zap"

"github.com/argoproj/argo-cd/v2/reposerver/apiclient"
logutils "github.com/argoproj/argo-cd/v2/util/log"
"github.com/argoproj/argo-cd/v2/util/tls"

"github.com/argoproj/argo-cd/v2/applicationset/controllers"
Expand Down Expand Up @@ -95,6 +97,8 @@ func NewCommand() *cobra.Command {
cli.SetLogFormat(cmdutil.LogFormat)
cli.SetLogLevel(cmdutil.LogLevel)

ctrl.SetLogger(logutils.NewLogrusLogger(logutils.NewWithCurrentConfig()))

restConfig, err := clientConfig.ClientConfig()
errors.CheckError(err)

Expand Down
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ require (
github.com/distribution/reference v0.5.0 // indirect
github.com/go-fed/httpsig v1.1.0 // indirect
github.com/go-jose/go-jose/v4 v4.0.1 // indirect
github.com/go-logr/zapr v1.3.0 // indirect
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/s2a-go v0.1.7 // indirect
Expand All @@ -146,6 +147,8 @@ require (
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect
go.opencensus.io v0.24.0 // indirect
go.starlark.net v0.0.0-20230525235612-a134d8f9ddca // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.26.0 // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/text v0.15.0 // indirect
Expand Down

0 comments on commit 020cb1d

Please sign in to comment.