Skip to content

Commit

Permalink
fix(misconf): use log instead of fmt for logging (#8033)
Browse files Browse the repository at this point in the history
Signed-off-by: nikpivkin <nikita.pivkin@smartforce.io>
  • Loading branch information
nikpivkin authored Dec 4, 2024
1 parent 775f954 commit 07b2d7f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/iac/scanners/cloudformation/parser/property_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package parser

import (
"fmt"
"os"
"strconv"
"strings"

"github.com/aquasecurity/trivy/pkg/iac/scanners/cloudformation/cftypes"
"github.com/aquasecurity/trivy/pkg/log"
)

func (p *Property) IsConvertableTo(conversionType cftypes.CfType) bool {
Expand Down Expand Up @@ -75,7 +75,11 @@ func (p *Property) ConvertTo(conversionType cftypes.CfType) *Property {
}

if !p.IsConvertableTo(conversionType) {
_, _ = fmt.Fprintf(os.Stderr, "property of type %s cannot be converted to %s\n", p.Type(), conversionType)
log.Debug("Failed to convert property",
log.String("from", string(p.Type())),
log.String("to", string(conversionType)),
log.Any("range", p.Range().String()),
)
return p
}
switch conversionType {
Expand Down

0 comments on commit 07b2d7f

Please sign in to comment.