Skip to content

Commit

Permalink
log: Remove logrus, use slog
Browse files Browse the repository at this point in the history
* Resolves #58

Signed-off-by: Micah Hausler <[email protected]>
  • Loading branch information
micahhausler committed Sep 27, 2023
1 parent d3976cb commit dbc2be1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ require (
github.com/google/go-cmp v0.5.9
github.com/in-toto/in-toto-golang v0.9.0
github.com/owenrumney/go-sarif v1.1.1
github.com/sirupsen/logrus v1.9.3
gopkg.in/yaml.v3 v3.0.1
)

Expand Down
3 changes: 0 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ github.com/secure-systems-lab/go-securesystemslib v0.6.0 h1:T65atpAVCJQK14UA57LM
github.com/secure-systems-lab/go-securesystemslib v0.6.0/go.mod h1:8Mtpo9JKks/qhPG4HGZ2LGMvrPbzuxwfz/f/zLfEWkk=
github.com/shibumi/go-pathspec v1.3.0 h1:QUyMZhFo0Md5B8zV8x2tesohbb5kfbpTi9rBnKh5dkI=
github.com/shibumi/go-pathspec v1.3.0/go.mod h1:Xutfslp817l2I1cZvgcfeMQJG5QnU2lh5tVaaMCl3jE=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
Expand All @@ -49,7 +47,6 @@ golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.7.0 h1:BEvjmm5fURWqcfbSKTdpkDXYBrUS1c0m8agp14W48vQ=
Expand Down
4 changes: 2 additions & 2 deletions pkg/vex/functions_files.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import (
"bytes"
"encoding/json"
"fmt"
"log/slog"
"os"
"strings"
"time"

"github.com/openvex/go-vex/pkg/csaf"
"github.com/sirupsen/logrus"
"gopkg.in/yaml.v3"
)

Expand Down Expand Up @@ -118,7 +118,7 @@ func Open(path string) (*VEX, error) {
}

if bytes.Contains(data, []byte(`"csaf_version"`)) {
logrus.Info("Abriendo CSAF")
slog.Info("Abriendo CSAF")

doc, err := OpenCSAF(path, []string{})
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions pkg/vex/vex.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ import (
"encoding/json"
"fmt"
"io"
"log/slog"
"os"
"sort"
"strconv"
"strings"
"time"

"github.com/package-url/packageurl-go"
"github.com/sirupsen/logrus"
)

const (
Expand Down Expand Up @@ -103,7 +103,7 @@ func New() VEX {
now := time.Now()
t, err := DateFromEnv()
if err != nil {
logrus.Warn(err)
slog.Warn(err.Error())
}
if t != nil {
now = *t
Expand Down Expand Up @@ -156,7 +156,7 @@ func (vexDoc *VEX) EffectiveStatement(product, vulnID string) (s *Statement) {
//
// Deprecated: vex.StatementFromID is deprecated and will be removed in an upcoming version
func (vexDoc *VEX) StatementFromID(id string) *Statement {
logrus.Warn("vex.StatementFromID is deprecated and will be removed in an upcoming version")
slog.Warn("vex.StatementFromID is deprecated and will be removed in an upcoming version")
for i := range vexDoc.Statements {
if string(vexDoc.Statements[i].Vulnerability.Name) == id && len(vexDoc.Statements[i].Products) > 0 {
return vexDoc.EffectiveStatement(vexDoc.Statements[i].Products[0].ID, id)
Expand Down

0 comments on commit dbc2be1

Please sign in to comment.