[#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:
parent
4baf00aa21
commit
f037022a7a
83 changed files with 207 additions and 156 deletions
|
@ -6,6 +6,7 @@ import (
|
|||
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/blobstor/common"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/blobstor/fstree"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/shard/mode"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/util/logger"
|
||||
"github.com/nspcc-dev/neofs-sdk-go/object"
|
||||
oid "github.com/nspcc-dev/neofs-sdk-go/object/id"
|
||||
"go.etcd.io/bbolt"
|
||||
|
@ -26,7 +27,7 @@ type Cache interface {
|
|||
Iterate(IterationPrm) error
|
||||
Put(common.PutPrm) (common.PutRes, error)
|
||||
SetMode(mode.Mode) error
|
||||
SetLogger(*zap.Logger)
|
||||
SetLogger(*logger.Logger)
|
||||
DumpInfo() Info
|
||||
Flush(bool) error
|
||||
|
||||
|
@ -84,7 +85,7 @@ func New(opts ...Option) Cache {
|
|||
|
||||
compressFlags: make(map[string]struct{}),
|
||||
options: options{
|
||||
log: zap.NewNop(),
|
||||
log: &logger.Logger{Logger: zap.NewNop()},
|
||||
maxObjectSize: defaultMaxObjectSize,
|
||||
smallObjectSize: defaultSmallObjectSize,
|
||||
workersCount: defaultFlushWorkersCount,
|
||||
|
@ -108,7 +109,7 @@ func New(opts ...Option) Cache {
|
|||
}
|
||||
|
||||
// SetLogger sets logger. It is used after the shard ID was generated to use it in logs.
|
||||
func (c *cache) SetLogger(l *zap.Logger) {
|
||||
func (c *cache) SetLogger(l *logger.Logger) {
|
||||
c.log = l
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue