Skip to content

Commit

Permalink
Remove logrus dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
martialblog committed Sep 14, 2023
1 parent d6ddd36 commit 0cad401
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 31 deletions.
14 changes: 0 additions & 14 deletions api/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import (
"io"
"net/http"
"net/url"

log "github.com/sirupsen/logrus"
)

type ResponseBody struct {
Expand Down Expand Up @@ -72,18 +70,6 @@ func (c *Client) GetJSONResponse(req *http.Request) (data *ResponseBody, err err
errInfo += fmt.Sprintf(" - %s: %s", e.Title, e.Detail)
}

if err == nil {
log.WithFields(log.Fields{
"status": res.StatusCode,
"errors": data.Errors,
}).Debug("HTTP returned non-ok result")
} else {
log.WithFields(log.Fields{
"status": res.StatusCode,
"body": string(body),
}).Debug("HTTP returned non-ok result without JSON info")
}

err = fmt.Errorf("HTTP request returned non-ok status %s%s", res.Status, errInfo)

return
Expand Down
7 changes: 0 additions & 7 deletions api/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ package api

import (
"net/http"

log "github.com/sirupsen/logrus"
)

type LoggingRoundTripper struct {
Expand All @@ -19,11 +17,6 @@ func NewLoggingHTTPClient() *http.Client {
}

func (r LoggingRoundTripper) RoundTrip(req *http.Request) (res *http.Response, err error) {
log.WithFields(log.Fields{
"url": req.URL,
"method": req.Method,
}).Debug("executing http request")

res, err = r.Base.RoundTrip(req)

return
Expand Down
2 changes: 0 additions & 2 deletions check.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (

"github.com/NETWAYS/check_sentinelone/api"
"github.com/NETWAYS/go-check"
log "github.com/sirupsen/logrus"
"github.com/spf13/pflag"
)

Expand Down Expand Up @@ -180,7 +179,6 @@ func lookupSiteID(client *api.Client, name string) (id string, err error) {
err = fmt.Errorf("could not find a site named '%s'", name)
case 1:
id = sites[0].ID
log.WithField("id", id).Debug("found site")
default:
err = fmt.Errorf("more than one site matches '%s'", name)
}
Expand Down
2 changes: 0 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ go 1.21
require (
github.com/NETWAYS/go-check v0.5.0
github.com/jarcoal/httpmock v1.3.1
github.com/sirupsen/logrus v1.9.3
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.8.4
golang.org/x/oauth2 v0.12.0
Expand All @@ -16,7 +15,6 @@ require (
github.com/golang/protobuf v1.5.3 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
golang.org/x/net v0.15.0 // indirect
golang.org/x/sys v0.12.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
6 changes: 0 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,11 @@ github.com/maxatome/go-testdeep v1.12.0 h1:Ql7Go8Tg0C1D/uMMX59LAoYK7LffeJQ6X2T04
github.com/maxatome/go-testdeep v1.12.0/go.mod h1:lPZc/HAcJMP92l7yI6TRz1aZN5URwUBUAfUNvrclaNM=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
Expand All @@ -35,9 +32,6 @@ golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
golang.org/x/oauth2 v0.12.0 h1:smVPGxink+n1ZI5pkQa8y6fZT0RW0MgCO5bFpepy4B4=
golang.org/x/oauth2 v0.12.0/go.mod h1:A74bZ3aGXgCY0qaIC9Ahg6Lglin4AMAco8cIv9baba4=
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.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
Expand Down

0 comments on commit 0cad401

Please sign in to comment.