Skip to content

Commit

Permalink
less verbose java logging when non-fatal issues arise (#3208)
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
  • Loading branch information
wagoodman authored Sep 9, 2024
1 parent 0a3f513 commit b153b1d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions syft/pkg/cataloger/java/archive_filename.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,19 @@ type archiveFilename struct {

func getSubexp(matches []string, subexpName string, re *regexp.Regexp, raw string) string {
if len(matches) < 1 {
log.Warnf("unexpectedly empty matches for archive '%s'", raw)
log.Tracef("unexpectedly empty matches for Java archive '%s'", raw)
return ""
}

index := re.SubexpIndex(subexpName)
if index < 1 {
log.Warnf("unexpected index of '%s' capture group for Java archive '%s'", subexpName, raw)
log.Tracef("unexpected index of '%s' capture group for Java archive '%s'", subexpName, raw)
return ""
}

// Prevent out-of-range panic
if len(matches) < index+1 {
log.Warnf("no match found for '%s' in '%s'", subexpName, matches[0])
log.Tracef("no match found for '%s' in '%s' for Java archive", subexpName, matches[0])
return ""
}

Expand Down

0 comments on commit b153b1d

Please sign in to comment.