1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-04 21:35:23 +02:00

feat(logging): replace all the loggers with zerolog EE-4186 (#7663)

This commit is contained in:
andres-portainer 2022-09-16 13:18:44 -03:00 committed by GitHub
parent 53025178ef
commit 36e7981ab7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
109 changed files with 1101 additions and 662 deletions

View file

@ -6,13 +6,14 @@ import (
"errors"
"fmt"
"io/ioutil"
"log"
"net/http"
"net/url"
"strings"
"time"
"github.com/portainer/portainer/api"
portainer "github.com/portainer/portainer/api"
"github.com/rs/zerolog/log"
)
var errInvalidResponseStatus = errors.New("Invalid response status (expecting 200)")
@ -90,7 +91,8 @@ func Get(url string, timeout int) ([]byte, error) {
defer response.Body.Close()
if response.StatusCode != http.StatusOK {
log.Printf("[ERROR] [http,client] [message: unexpected status code] [status_code: %d]", response.StatusCode)
log.Error().Int("status_code", response.StatusCode).Msg("unexpected status code")
return nil, errInvalidResponseStatus
}