diff --git a/cmd/neofs-node/object.go b/cmd/neofs-node/object.go index d5c1d3375..2c4cf8986 100644 --- a/cmd/neofs-node/object.go +++ b/cmd/neofs-node/object.go @@ -286,6 +286,7 @@ func initObjectService(c *cfg) { headsvc.WithLocalAddressSource(c), headsvc.WithRightChildSearcher(searchsvc.NewRightChildSearcher(sSearch)), headsvc.WithWorkerPool(c.cfgObject.pool.head), + headsvc.WithLogger(c.log), ) sHeadV2 := headsvcV2.NewService( diff --git a/pkg/services/object/head/service.go b/pkg/services/object/head/service.go index 1c86aaa9e..02e38ade1 100644 --- a/pkg/services/object/head/service.go +++ b/pkg/services/object/head/service.go @@ -11,7 +11,9 @@ import ( "github.com/nspcc-dev/neofs-node/pkg/network/cache" objutil "github.com/nspcc-dev/neofs-node/pkg/services/object/util" "github.com/nspcc-dev/neofs-node/pkg/util" + "github.com/nspcc-dev/neofs-node/pkg/util/logger" "github.com/pkg/errors" + "go.uber.org/zap" ) type RelationSearcher interface { @@ -38,6 +40,8 @@ type cfg struct { localHeader localHeader remoteHeader RemoteHeader + + log *logger.Logger } var ErrNotFound = errors.New("object header not found") @@ -45,6 +49,7 @@ var ErrNotFound = errors.New("object header not found") func defaultCfg() *cfg { return &cfg{ workerPool: new(util.SyncWorkerPool), + log: zap.L(), } } @@ -141,3 +146,9 @@ func WithClientCache(v *cache.ClientCache) Option { c.remoteHeader.clientCache = v } } + +func WithLogger(l *logger.Logger) Option { + return func(c *cfg) { + c.log = l + } +}