less verbose java logging when non-fatal issues arise (#3208)

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
This commit is contained in:
Alex Goodman 2024-09-09 11:27:59 -04:00 committed by GitHub
parent 0a3f513f92
commit b153b1d594
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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 ""
}