Skip to content

Commit dbc2be1

Browse files
committed
log: Remove logrus, use slog
* Resolves #58 Signed-off-by: Micah Hausler <[email protected]>
1 parent d3976cb commit dbc2be1

File tree

4 files changed

+5
-9
lines changed

4 files changed

+5
-9
lines changed

go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ require (
66
github.com/google/go-cmp v0.5.9
77
github.com/in-toto/in-toto-golang v0.9.0
88
github.com/owenrumney/go-sarif v1.1.1
9-
github.com/sirupsen/logrus v1.9.3
109
gopkg.in/yaml.v3 v3.0.1
1110
)
1211

go.sum

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ github.com/secure-systems-lab/go-securesystemslib v0.6.0 h1:T65atpAVCJQK14UA57LM
3333
github.com/secure-systems-lab/go-securesystemslib v0.6.0/go.mod h1:8Mtpo9JKks/qhPG4HGZ2LGMvrPbzuxwfz/f/zLfEWkk=
3434
github.com/shibumi/go-pathspec v1.3.0 h1:QUyMZhFo0Md5B8zV8x2tesohbb5kfbpTi9rBnKh5dkI=
3535
github.com/shibumi/go-pathspec v1.3.0/go.mod h1:Xutfslp817l2I1cZvgcfeMQJG5QnU2lh5tVaaMCl3jE=
36-
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
37-
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
3836
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
3937
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
4038
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
@@ -49,7 +47,6 @@ golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE
4947
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
5048
golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
5149
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
52-
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
5350
golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU=
5451
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
5552
golang.org/x/term v0.7.0 h1:BEvjmm5fURWqcfbSKTdpkDXYBrUS1c0m8agp14W48vQ=

pkg/vex/functions_files.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ import (
99
"bytes"
1010
"encoding/json"
1111
"fmt"
12+
"log/slog"
1213
"os"
1314
"strings"
1415
"time"
1516

1617
"github.com/openvex/go-vex/pkg/csaf"
17-
"github.com/sirupsen/logrus"
1818
"gopkg.in/yaml.v3"
1919
)
2020

@@ -118,7 +118,7 @@ func Open(path string) (*VEX, error) {
118118
}
119119

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

123123
doc, err := OpenCSAF(path, []string{})
124124
if err != nil {

pkg/vex/vex.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ import (
1010
"encoding/json"
1111
"fmt"
1212
"io"
13+
"log/slog"
1314
"os"
1415
"sort"
1516
"strconv"
1617
"strings"
1718
"time"
1819

1920
"github.com/package-url/packageurl-go"
20-
"github.com/sirupsen/logrus"
2121
)
2222

2323
const (
@@ -103,7 +103,7 @@ func New() VEX {
103103
now := time.Now()
104104
t, err := DateFromEnv()
105105
if err != nil {
106-
logrus.Warn(err)
106+
slog.Warn(err.Error())
107107
}
108108
if t != nil {
109109
now = *t
@@ -156,7 +156,7 @@ func (vexDoc *VEX) EffectiveStatement(product, vulnID string) (s *Statement) {
156156
//
157157
// Deprecated: vex.StatementFromID is deprecated and will be removed in an upcoming version
158158
func (vexDoc *VEX) StatementFromID(id string) *Statement {
159-
logrus.Warn("vex.StatementFromID is deprecated and will be removed in an upcoming version")
159+
slog.Warn("vex.StatementFromID is deprecated and will be removed in an upcoming version")
160160
for i := range vexDoc.Statements {
161161
if string(vexDoc.Statements[i].Vulnerability.Name) == id && len(vexDoc.Statements[i].Products) > 0 {
162162
return vexDoc.EffectiveStatement(vexDoc.Statements[i].Products[0].ID, id)

0 commit comments

Comments
 (0)