mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 16:33:21 +01: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
@ -58,19 +58,19 @@ type archiveFilename struct {
|
|||||||
|
|
||||||
func getSubexp(matches []string, subexpName string, re *regexp.Regexp, raw string) string {
|
func getSubexp(matches []string, subexpName string, re *regexp.Regexp, raw string) string {
|
||||||
if len(matches) < 1 {
|
if len(matches) < 1 {
|
||||||
log.Warnf("unexpectedly empty matches for archive '%s'", raw)
|
log.Tracef("unexpectedly empty matches for Java archive '%s'", raw)
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
index := re.SubexpIndex(subexpName)
|
index := re.SubexpIndex(subexpName)
|
||||||
if index < 1 {
|
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 ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prevent out-of-range panic
|
// Prevent out-of-range panic
|
||||||
if len(matches) < index+1 {
|
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 ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user