From fd9a8b873bae583652b3cb9ad5ff371790c686ea Mon Sep 17 00:00:00 2001 From: miampf Date: Wed, 3 Apr 2024 13:36:03 +0200 Subject: [PATCH] rewritten forgotten flag prints --- hack/bazel-deps-mirror/check.go | 6 +----- hack/bazel-deps-mirror/fix.go | 6 +----- hack/oci-pin/sum.go | 6 +----- internal/api/versionsapi/cli/add.go | 13 ++----------- internal/api/versionsapi/cli/latest.go | 7 +------ internal/api/versionsapi/cli/list.go | 14 ++------------ 6 files changed, 8 insertions(+), 44 deletions(-) diff --git a/hack/bazel-deps-mirror/check.go b/hack/bazel-deps-mirror/check.go index 7a35b9068a..465e46f7fd 100644 --- a/hack/bazel-deps-mirror/check.go +++ b/hack/bazel-deps-mirror/check.go @@ -40,11 +40,7 @@ func runCheck(cmd *cobra.Command, _ []string) error { return err } log := logger.NewTextLogger(flags.logLevel) - log.Debug(fmt.Sprintf( - `Parsed flags: - mirror: %t - mirror-unauthenticated: %t -`, flags.mirror, flags.mirrorUnauthenticated)) + log.Debug("Using flags", "mirror", flags.mirror, "mirrorUnauthenticated", flags.mirrorUnauthenticated) filesHelper, err := bazelfiles.New() if err != nil { diff --git a/hack/bazel-deps-mirror/fix.go b/hack/bazel-deps-mirror/fix.go index 7904713bc1..dd231cd068 100644 --- a/hack/bazel-deps-mirror/fix.go +++ b/hack/bazel-deps-mirror/fix.go @@ -40,11 +40,7 @@ func runFix(cmd *cobra.Command, _ []string) error { return err } log := logger.NewTextLogger(flags.logLevel) - log.Debug(fmt.Sprintf( - `Parsed flags: - unauthenticated: %t - dry-run: %t`, - flags.unauthenticated, flags.dryRun)) + log.Debug("Using flags", "unauthenticated", flags.unauthenticated, "dryRun", flags.dryRun) fileHelper, err := bazelfiles.New() if err != nil { diff --git a/hack/oci-pin/sum.go b/hack/oci-pin/sum.go index 03d1615c5e..feacd8ca15 100644 --- a/hack/oci-pin/sum.go +++ b/hack/oci-pin/sum.go @@ -42,11 +42,7 @@ func runSum(cmd *cobra.Command, _ []string) error { return err } log := logger.NewTextLogger(flags.logLevel) - log.Debug(fmt.Sprintf( - `Parsed flags: - image-repo-tag: %q - oci-path: %q`, - flags.imageRepoTag, flags.ociPath)) + log.Debug("Using flags", "imageRepoTag", flags.imageRepoTag, "ociPath", flags.ociPath) registry, prefix, name, tag, err := splitRepoTag(flags.imageRepoTag) if err != nil { diff --git a/internal/api/versionsapi/cli/add.go b/internal/api/versionsapi/cli/add.go index a585860c57..f1a6fc4fde 100644 --- a/internal/api/versionsapi/cli/add.go +++ b/internal/api/versionsapi/cli/add.go @@ -53,17 +53,8 @@ func runAdd(cmd *cobra.Command, _ []string) (retErr error) { return err } log := logger.NewTextLogger(flags.logLevel) - log.Debug(fmt.Sprintf( - `Parsed flags: - dryrun: %t - kind: %q - latest: %t - ref: %q - release: %t - stream: %q - version: %q`, - flags.dryRun, flags.kind, flags.latest, flags.ref, - flags.release, flags.stream, flags.version)) + log.Debug("Using flags", "dryRun", flags.dryRun, "kind", flags.kind, "latest", flags.latest, "ref", flags.ref, + "release", flags.release, "stream", flags.stream, "version", flags.version) log.Debug("Validating flags") if err := flags.validate(log); err != nil { diff --git a/internal/api/versionsapi/cli/latest.go b/internal/api/versionsapi/cli/latest.go index cd071eb8be..6b3c3983f8 100644 --- a/internal/api/versionsapi/cli/latest.go +++ b/internal/api/versionsapi/cli/latest.go @@ -39,12 +39,7 @@ func runLatest(cmd *cobra.Command, _ []string) (retErr error) { return err } log := logger.NewTextLogger(flags.logLevel) - log.Debug(fmt.Sprintf( - `Parsed flags: - ref: %q - stream: %q - json: %t -`, flags.ref, flags.stream, flags.json)) + log.Debug("Using flags", "ref", flags.ref, "stream", flags.stream, "json", flags.json) log.Debug("Validating flags") if err := flags.validate(); err != nil { diff --git a/internal/api/versionsapi/cli/list.go b/internal/api/versionsapi/cli/list.go index ab8981ff53..1aa6d88c67 100644 --- a/internal/api/versionsapi/cli/list.go +++ b/internal/api/versionsapi/cli/list.go @@ -44,18 +44,8 @@ func runList(cmd *cobra.Command, _ []string) (retErr error) { return err } log := logger.NewTextLogger(flags.logLevel) - log.Debug(fmt.Sprintf( - `Parsed flags: - bucket: %q - distribution-id: %q - json: %t - verbose: %v - minor-version: %q - ref: %q - region: %q - stream: %q`, - flags.bucket, flags.distributionID, flags.json, flags.logLevel, flags.minorVersion, - flags.ref, flags.region, flags.stream)) + log.Debug("Using flags", "bucket", flags.bucket, "distributionID", flags.distributionID, "json", flags.json, "minorVersion", flags.minorVersion, + "ref", flags.ref, "region", flags.region, "stream", flags.stream) log.Debug("Validating flags") if err := flags.validate(); err != nil {