[#1770] logger: Refactor Logger component

Make it store its internal `zap.Logger`'s level. Also, make all the
components to accept internal `logger.Logger` instead of `zap.Logger`; it
will simplify future refactor.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2022-09-28 10:41:01 +03:00 committed by Pavel Karpy
parent 4baf00aa21
commit f037022a7a
83 changed files with 207 additions and 156 deletions

View file

@ -3,6 +3,7 @@ package notificator
import (
"fmt"
"github.com/nspcc-dev/neofs-node/pkg/util/logger"
oid "github.com/nspcc-dev/neofs-sdk-go/object/id"
"go.uber.org/zap"
)
@ -12,11 +13,11 @@ import (
type Prm struct {
writer NotificationWriter
notificationSource NotificationSource
logger *zap.Logger
logger *logger.Logger
}
// SetLogger sets a logger.
func (prm *Prm) SetLogger(v *zap.Logger) *Prm {
func (prm *Prm) SetLogger(v *logger.Logger) *Prm {
prm.logger = v
return prm
}
@ -43,7 +44,7 @@ func (prm *Prm) SetNotificationSource(v NotificationSource) *Prm {
type Notificator struct {
w NotificationWriter
ns NotificationSource
l *zap.Logger
l *logger.Logger
}
// New creates, initializes and returns the Notificator instance.