Skip to content

Commit

Permalink
http: Reduce verbosity in agent
Browse files Browse the repository at this point in the history
This commit reduces the http verbosity in the
https agent. It will not print the requests
made unless logrus is at debug level.

Signed-off-by: Adolfo García Veytia (Puerco) <adolfo.garcia@uservers.net>
  • Loading branch information
puerco committed Sep 1, 2022
1 parent 882cd54 commit 5deb0c0
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions http/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,7 @@ func (a *Agent) Get(url string) (content []byte, err error) {

// GetRequest sends a GET request to a URL and returns the request and response
func (a *Agent) GetRequest(url string) (response *http.Response, err error) {
logrus.Infof("Sending GET request to %s", url)
logrus.Debug()
logrus.Debugf("Sending GET request to %s", url)
try := 0
for {
response, err = a.AgentImplementation.SendGetRequest(a.Client(), url)
Expand Down Expand Up @@ -162,9 +161,7 @@ func (a *Agent) Post(url string, postData []byte) (content []byte, err error) {

// PostRequest sends the postData in a POST request to a URL and returns the request object
func (a *Agent) PostRequest(url string, postData []byte) (response *http.Response, err error) {
logrus.Infof("Sending POST request to %s", url)
logrus.Debug(a.options.String())

logrus.Debugf("Sending POST request to %s", url)
try := 0
for {
response, err = a.AgentImplementation.SendPostRequest(a.Client(), url, postData, a.options.PostContentType)
Expand Down

0 comments on commit 5deb0c0

Please sign in to comment.