Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

suppress logging from repo server #206

Merged
merged 2 commits into from
Oct 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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