From b317b1d1ebccca3e5702d1b6451c9f74f88eb720 Mon Sep 17 00:00:00 2001 From: Adrien <99400874+hubadr@users.noreply.github.com> Date: Thu, 17 Oct 2024 17:16:14 +0200 Subject: [PATCH] Add debug log for zip file content (#5152) Co-authored-by: thtri --- cmd/checkmarxOneExecuteScan.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmd/checkmarxOneExecuteScan.go b/cmd/checkmarxOneExecuteScan.go index d809304290..c457372c65 100644 --- a/cmd/checkmarxOneExecuteScan.go +++ b/cmd/checkmarxOneExecuteScan.go @@ -943,12 +943,15 @@ func (c *checkmarxOneExecuteScanHelper) zipFolder(source string, zipFile io.Writ return nil } + fileName := strings.TrimPrefix(path, baseDir) noMatch, err := c.isFileNotMatchingPattern(patterns, path, info, utils) if err != nil || noMatch { + if noMatch { + log.Entry().Debugf("Excluded %s", fileName) + } return err } - fileName := strings.TrimPrefix(path, baseDir) writer, err := archive.Create(fileName) if err != nil { return err @@ -960,6 +963,9 @@ func (c *checkmarxOneExecuteScanHelper) zipFolder(source string, zipFile io.Writ } defer file.Close() _, err = io.Copy(writer, file) + if err == nil { + log.Entry().Debugf("Zipped %s", fileName) + } fileCount++ return err })