From 3e874998ff9a9a222f0723067b4fa931f07d9268 Mon Sep 17 00:00:00 2001 From: Erik Kristensen Date: Sun, 10 Nov 2024 09:44:22 -0700 Subject: [PATCH] refactor: improve logging --- pkg/provider/provider.go | 6 +++--- pkg/source/github.go | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/provider/provider.go b/pkg/provider/provider.go index 38233a0..91ef35b 100644 --- a/pkg/provider/provider.go +++ b/pkg/provider/provider.go @@ -377,11 +377,11 @@ func (p *Provider) discoverSignature(version string) error { //nolint:gocyclo // Note: we want to look for the best binary by looking at binaries, archives and unknowns for _, t := range []asset.Type{asset.Signature} { if len(fileScored[t]) > 0 { - logger.Tracef("top scored (%d): %s (%d)", t, fileScored[t][0].Key, fileScored[t][0].Value) + logger.WithField("type", "signature").Tracef("top scored (%d): %s (%d)", t, fileScored[t][0].Key, fileScored[t][0].Value) topScored := fileScored[t][0] if topScored.Value < 40 { - logger.Tracef("skipped > (%d) too low: %s (%d)", t, topScored.Key, topScored.Value) + logger.WithField("type", "signature").Tracef("skipped > (%d) too low: %s (%d)", t, topScored.Key, topScored.Value) continue } for _, a := range p.Assets { @@ -627,7 +627,7 @@ func (p *Provider) verifyCosignSignature() error { //nolint:gocyclo return err } if err := json.Unmarshal(sigData, &bundle); err != nil { - log.WithError(err).Trace("unable to parse json for bundle signature") + log.WithError(err).Debug("unable to parse json for bundle signature") } if bundle == nil { diff --git a/pkg/source/github.go b/pkg/source/github.go index 1d82876..87a8607 100644 --- a/pkg/source/github.go +++ b/pkg/source/github.go @@ -134,6 +134,7 @@ func (s *GitHub) FindRelease(ctx context.Context) error { return err } + for _, r := range releases { includePreReleases := s.Options.Settings["include-pre-releases"].(bool) if includePreReleases && r.GetPrerelease() {