diff --git a/api/response.go b/api/response.go index c990198..37ae26c 100644 --- a/api/response.go +++ b/api/response.go @@ -6,8 +6,6 @@ import ( "io" "net/http" "net/url" - - log "github.com/sirupsen/logrus" ) type ResponseBody struct { @@ -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 diff --git a/api/trace.go b/api/trace.go index 59f73e0..2ca63ce 100644 --- a/api/trace.go +++ b/api/trace.go @@ -2,8 +2,6 @@ package api import ( "net/http" - - log "github.com/sirupsen/logrus" ) type LoggingRoundTripper struct { @@ -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 diff --git a/check.go b/check.go index 8c125d7..28b091a 100644 --- a/check.go +++ b/check.go @@ -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" ) @@ -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) } diff --git a/go.mod b/go.mod index fa2ba2c..880af75 100644 --- a/go.mod +++ b/go.mod @@ -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 @@ -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 diff --git a/go.sum b/go.sum index a41597d..79641b0 100644 --- a/go.sum +++ b/go.sum @@ -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= @@ -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=