[#1953] blobstor: Log any object removal operation

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2022-10-21 20:51:31 +03:00 committed by fyrchik
parent 942cc38146
commit 41f93dcc1d
3 changed files with 34 additions and 16 deletions

View file

@ -0,0 +1,19 @@
package blobstor
import (
storagelog "github.com/nspcc-dev/neofs-node/pkg/local_object_storage/internal/log"
"github.com/nspcc-dev/neofs-node/pkg/util/logger"
oid "github.com/nspcc-dev/neofs-sdk-go/object/id"
)
const deleteOp = "DELETE"
const putOp = "PUT"
func logOp(l *logger.Logger, op string, addr oid.Address, typ string, sID []byte) {
storagelog.Write(l,
storagelog.AddressField(addr),
storagelog.OpField(op),
storagelog.StorageTypeField(typ),
storagelog.StorageIDField(sID),
)
}