From 942cc381466d4deff564bf4780bf936930157f17 Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Fri, 21 Oct 2022 20:50:33 +0300 Subject: [PATCH] [#1953] engine: Add refactored storage helpers After the refactor there are new storage characteristics: a type and a general storage id (that could be stringified). Signed-off-by: Pavel Karpy --- pkg/local_object_storage/internal/log/log.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkg/local_object_storage/internal/log/log.go b/pkg/local_object_storage/internal/log/log.go index 6424b20948..dcd336614d 100644 --- a/pkg/local_object_storage/internal/log/log.go +++ b/pkg/local_object_storage/internal/log/log.go @@ -24,3 +24,13 @@ func AddressField(addr interface{}) zap.Field { func OpField(op string) zap.Field { return zap.String("op", op) } + +// StorageTypeField returns logger's field for storage type. +func StorageTypeField(typ string) zap.Field { + return zap.String("type", typ) +} + +// StorageIDField returns logger's field for storage ID. +func StorageIDField(id []byte) zap.Field { + return zap.String("storage_id", string(id)) +}