mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-23 07:29:00 -08:00
refactor: replace zap with slog (#6466)
Signed-off-by: knqyf263 <knqyf263@gmail.com> Co-authored-by: Nikita Pivkin <nikita.pivkin@smartforce.io> Co-authored-by: simar7 <1254783+simar7@users.noreply.github.com>
This commit is contained in:
@@ -28,10 +28,14 @@ type packageInfo struct {
|
||||
EndLine int
|
||||
}
|
||||
|
||||
type Parser struct{}
|
||||
type Parser struct {
|
||||
logger *log.Logger
|
||||
}
|
||||
|
||||
func NewParser() types.Parser {
|
||||
return &Parser{}
|
||||
return &Parser{
|
||||
logger: log.WithPrefix("composer"),
|
||||
}
|
||||
}
|
||||
|
||||
func (p *Parser) Parse(r xio.ReadSeekerAt) ([]types.Library, []types.Dependency, error) {
|
||||
@@ -85,7 +89,7 @@ func (p *Parser) Parse(r xio.ReadSeekerAt) ([]types.Library, []types.Dependency,
|
||||
dependsOn = append(dependsOn, lib.ID)
|
||||
continue
|
||||
}
|
||||
log.Logger.Debugf("unable to find version of %s", depName)
|
||||
p.logger.Debug("Unable to find version", log.String("name", depName))
|
||||
}
|
||||
sort.Strings(dependsOn)
|
||||
deps = append(deps, types.Dependency{
|
||||
|
||||
Reference in New Issue
Block a user