mirror of
https://github.com/anchore/syft
synced 2024-11-10 06:14:16 +00:00
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:
parent
0a3f513f92
commit
b153b1d594
1 changed files with 3 additions and 3 deletions
|
@ -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 ""
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue