Skip to content

Commit

Permalink
donot use fmt to log
Browse files Browse the repository at this point in the history
using fmt writes the error log to stdout, that then goes to json. which we don't want.
  • Loading branch information
ibreakthecloud authored Jun 21, 2024
1 parent 7b148f7 commit 348af37
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/scan/process_image.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ func ScanFile(s *Scanner, f *os.File, iocs *[]output.IOCFound, layer string) err
}
err = yrScanner.ScanFileDescriptor(f.Fd())
if err != nil {
fmt.Println("Scan File Descriptor error, trying alternative", err)
logrus.Errorf("yara: %s: Error scanning file, error=%s, trying alternative", fileName, err.Error())
var buf []byte
if buf, err = io.ReadAll(f); err != nil {
logrus.Errorf("yara: %s: Error reading file, error=%s",
Expand All @@ -271,7 +271,7 @@ func ScanFile(s *Scanner, f *os.File, iocs *[]output.IOCFound, layer string) err
}
err = yrScanner.ScanMem(buf)
if err != nil {
fmt.Println("Scan File Mmory Error", err)
logrus.Errorf("yara: %s: Error scanning file, error=%s", fileName, err.Error())
return filepath.SkipDir
}

Expand Down

0 comments on commit 348af37

Please sign in to comment.