Skip to content

Commit

Permalink
suppress logging from repo server (#206)
Browse files Browse the repository at this point in the history
Signed-off-by: Kent <[email protected]>
Signed-off-by: Kent Rancourt <[email protected]>
  • Loading branch information
krancour authored Oct 23, 2023
1 parent 2c78951 commit a767b23
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions cmd/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,24 @@ package cli
import (
"fmt"
"os"

log "github.com/sirupsen/logrus"
)

func Run() {
// These two lines are required to suppress log output from the Argo CD repo
// server, which Kargo Render uses as a library.
//
// Without suppressing this, requests for machine-readable output (e.g. JSON)
// will be polluted with log output and attempts to parse it (e.g. by Kargo)
// will fail.
//
// This does NOT interfere with using the Kargo Render CLI's own --debug flag,
// however, choosing that will, once again, result in some amount of
// unparsable output.
os.Setenv("ARGOCD_LOG_LEVEL", "PANIC")
log.SetLevel(log.PanicLevel)

cmd, err := newRootCommand()
if err != nil {
fmt.Println(err)
Expand Down

0 comments on commit a767b23

Please sign in to comment.