From f72bc538b9dd6d4ef5f314bfe30a303527672e33 Mon Sep 17 00:00:00 2001 From: Denis Kirillov Date: Fri, 24 Jun 2022 17:34:44 +0300 Subject: [PATCH] [#551] Refactor notifications logs Signed-off-by: Denis Kirillov --- api/handler/api.go | 4 +++- api/handler/notifications.go | 2 -- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/handler/api.go b/api/handler/api.go index 465864635..c1e759b31 100644 --- a/api/handler/api.go +++ b/api/handler/api.go @@ -44,7 +44,9 @@ func New(log *zap.Logger, obj layer.Client, notificator Notificator, cfg *Config return nil, errors.New("empty logger") } - if cfg.NotificatorEnabled && notificator == nil { + if !cfg.NotificatorEnabled { + log.Warn("notificator is disabled, s3 won't produce notification events") + } else if notificator == nil { return nil, errors.New("empty notificator") } diff --git a/api/handler/notifications.go b/api/handler/notifications.go index 559f45227..a208ed744 100644 --- a/api/handler/notifications.go +++ b/api/handler/notifications.go @@ -13,7 +13,6 @@ import ( "github.com/nspcc-dev/neofs-s3-gw/api/errors" "github.com/nspcc-dev/neofs-s3-gw/api/layer" "github.com/nspcc-dev/neofs-sdk-go/bearer" - "go.uber.org/zap" ) type ( @@ -148,7 +147,6 @@ func (h *handler) GetBucketNotificationHandler(w http.ResponseWriter, r *http.Re func (h *handler) sendNotifications(ctx context.Context, p *SendNotificationParams) error { if !h.cfg.NotificatorEnabled { - h.log.Debug("could not send notification because notificator is disabled", zap.String("event", p.Event)) return nil }