Skip to content

Commit d964f26

Browse files
Merge pull request #7 from Checkmarx/dima/AST-83219-debug-logs-fix
debug logs fix - (AST-83219)
2 parents a43171c + 02ac56d commit d964f26

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pkg/containerResolver/containerScanner.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"github.com/Checkmarx/containers-images-extractor/pkg/imagesExtractor"
55
"github.com/Checkmarx/containers-syft-packages-extractor/pkg/syftPackagesExtractor"
66
"github.com/Checkmarx/containers-types/types"
7+
"github.com/rs/zerolog"
78
"github.com/rs/zerolog/log"
89
)
910

@@ -21,6 +22,12 @@ func NewContainerResolver() ContainersResolver {
2122

2223
func (cr *ContainersResolver) Resolve(scanPath string, resolutionFolderPath string, images []string, isDebug bool) error {
2324

25+
//checking if the debug flag is on and configure the logger
26+
if isDebug {
27+
zerolog.SetGlobalLevel(zerolog.DebugLevel)
28+
} else {
29+
zerolog.SetGlobalLevel(zerolog.InfoLevel)
30+
}
2431
log.Debug().Msgf("Resolve func parameters: scanPath=%s, resolutionFolderPath=%s, images=%s, isDebug=%t", scanPath, resolutionFolderPath, images, isDebug)
2532

2633
// 0. validate input

0 commit comments

Comments
 (0)