fix(logging): remove remaining traces of logrus EE-4414 (#7848)

pull/7854/head
andres-portainer 2 years ago committed by GitHub
parent ab3a6f402e
commit fd91de3571
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -4,10 +4,11 @@ import (
"fmt" "fmt"
"sync" "sync"
"github.com/pkg/errors"
portainer "github.com/portainer/portainer/api" portainer "github.com/portainer/portainer/api"
"github.com/portainer/portainer/api/edgetypes" "github.com/portainer/portainer/api/edgetypes"
"github.com/sirupsen/logrus"
"github.com/pkg/errors"
"github.com/rs/zerolog/log"
) )
const ( const (
@ -84,7 +85,7 @@ func (service *Service) List() ([]edgetypes.UpdateSchedule, error) {
func(obj interface{}) (interface{}, error) { func(obj interface{}) (interface{}, error) {
item, ok := obj.(*edgetypes.UpdateSchedule) item, ok := obj.(*edgetypes.UpdateSchedule)
if !ok { if !ok {
logrus.WithField("obj", obj).Errorf("Failed to convert to EdgeUpdateSchedule object") log.Debug().Str("obj", fmt.Sprintf("%#v", obj)).Msg("failed to convert to EdgeUpdateSchedule object")
return nil, fmt.Errorf("Failed to convert to EdgeUpdateSchedule object: %s", obj) return nil, fmt.Errorf("Failed to convert to EdgeUpdateSchedule object: %s", obj)
} }
list = append(list, *item) list = append(list, *item)

@ -4,7 +4,8 @@ import (
"fmt" "fmt"
portainer "github.com/portainer/portainer/api" portainer "github.com/portainer/portainer/api"
"github.com/sirupsen/logrus"
"github.com/rs/zerolog/log"
) )
const ( const (
@ -51,7 +52,7 @@ func (service *Service) Snapshots() ([]portainer.Snapshot, error) {
func(obj interface{}) (interface{}, error) { func(obj interface{}) (interface{}, error) {
snapshot, ok := obj.(*portainer.Snapshot) snapshot, ok := obj.(*portainer.Snapshot)
if !ok { if !ok {
logrus.WithField("obj", obj).Errorf("Failed to convert to Snapshot object") log.Debug().Str("obj", fmt.Sprintf("%#v", obj)).Msg("failed to convert to Snapshot object")
return nil, fmt.Errorf("failed to convert to Snapshot object: %s", obj) return nil, fmt.Errorf("failed to convert to Snapshot object: %s", obj)
} }
snapshots = append(snapshots, *snapshot) snapshots = append(snapshots, *snapshot)

@ -39,7 +39,6 @@ require (
github.com/rkl-/digest v0.0.0-20180419075440-8316caa4a777 github.com/rkl-/digest v0.0.0-20180419075440-8316caa4a777
github.com/robfig/cron/v3 v3.0.1 github.com/robfig/cron/v3 v3.0.1
github.com/rs/zerolog v1.28.0 github.com/rs/zerolog v1.28.0
github.com/sirupsen/logrus v1.8.1
github.com/stretchr/testify v1.7.0 github.com/stretchr/testify v1.7.0
github.com/viney-shih/go-lock v1.1.1 github.com/viney-shih/go-lock v1.1.1
go.etcd.io/bbolt v1.3.6 go.etcd.io/bbolt v1.3.6
@ -105,6 +104,7 @@ require (
github.com/opencontainers/image-spec v1.0.2 // indirect github.com/opencontainers/image-spec v1.0.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/sergi/go-diff v1.1.0 // indirect github.com/sergi/go-diff v1.1.0 // indirect
github.com/sirupsen/logrus v1.8.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect github.com/spf13/pflag v1.0.5 // indirect
github.com/tomasen/realip v0.0.0-20180522021738-f0c99a92ddce // indirect github.com/tomasen/realip v0.0.0-20180522021738-f0c99a92ddce // indirect
github.com/x448/float16 v0.8.4 // indirect github.com/x448/float16 v0.8.4 // indirect

Loading…
Cancel
Save