Skip to content

Commit 07b2d7f

Browse files
authored
fix(misconf): use log instead of fmt for logging (#8033)
Signed-off-by: nikpivkin <[email protected]>
1 parent 775f954 commit 07b2d7f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pkg/iac/scanners/cloudformation/parser/property_conversion.go

+6-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ package parser
22

33
import (
44
"fmt"
5-
"os"
65
"strconv"
76
"strings"
87

98
"github.com/aquasecurity/trivy/pkg/iac/scanners/cloudformation/cftypes"
9+
"github.com/aquasecurity/trivy/pkg/log"
1010
)
1111

1212
func (p *Property) IsConvertableTo(conversionType cftypes.CfType) bool {
@@ -75,7 +75,11 @@ func (p *Property) ConvertTo(conversionType cftypes.CfType) *Property {
7575
}
7676

7777
if !p.IsConvertableTo(conversionType) {
78-
_, _ = fmt.Fprintf(os.Stderr, "property of type %s cannot be converted to %s\n", p.Type(), conversionType)
78+
log.Debug("Failed to convert property",
79+
log.String("from", string(p.Type())),
80+
log.String("to", string(conversionType)),
81+
log.Any("range", p.Range().String()),
82+
)
7983
return p
8084
}
8185
switch conversionType {

0 commit comments

Comments
 (0)