From eecb6b7e758ce79383c2915f3942711a4d3433bc Mon Sep 17 00:00:00 2001 From: Hannes Gustafsson Date: Mon, 28 Oct 2024 08:33:36 +0000 Subject: [PATCH] Move log statement and change from info to debug The message seems to be informative only to developers i.e. better suited as a debug message. Moving it to the function that it is actually logging for ensures that it is always logged, instead of putting this burden on the caller. --- internal/pkg/githubapi/github.go | 1 - internal/pkg/githubapi/promotion.go | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/pkg/githubapi/github.go b/internal/pkg/githubapi/github.go index 1389f10..80fe974 100644 --- a/internal/pkg/githubapi/github.go +++ b/internal/pkg/githubapi/github.go @@ -277,7 +277,6 @@ func handleChangedPREvent(ctx context.Context, mainGithubClientPair GhClientPair ghPrClientDetails.PrLogger.Debugf("Diff not find affected ArogCD apps") } } - ghPrClientDetails.PrLogger.Infoln("Checking for Drift") err = DetectDrift(ghPrClientDetails) if err != nil { return fmt.Errorf("detecting drift: %w", err) diff --git a/internal/pkg/githubapi/promotion.go b/internal/pkg/githubapi/promotion.go index aac4edb..4d5bbba 100644 --- a/internal/pkg/githubapi/promotion.go +++ b/internal/pkg/githubapi/promotion.go @@ -51,6 +51,7 @@ func contains(s []string, str string) bool { } func DetectDrift(ghPrClientDetails GhPrClientDetails) error { + ghPrClientDetails.PrLogger.Debugln("Checking for Drift") if ghPrClientDetails.Ctx.Err() != nil { return ghPrClientDetails.Ctx.Err() }