[#240] logs: Move log messages to constants

Drop duplicate entities.
Format entities.

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2023-04-12 17:35:10 +03:00 committed by fyrchik
parent d29b13454f
commit 0e31c12e63
149 changed files with 1481 additions and 687 deletions

View file

@ -3,20 +3,21 @@ package deletesvc
import (
"context"
"git.frostfs.info/TrueCloudLab/frostfs-node/internal/logs"
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object"
oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id"
"go.uber.org/zap"
)
func (exec *execCtx) executeLocal(ctx context.Context) {
exec.log.Debug("forming tombstone structure...")
exec.log.Debug(logs.DeleteFormingTombstoneStructure)
ok := exec.formTombstone(ctx)
if !ok {
return
}
exec.log.Debug("tombstone structure successfully formed, saving...")
exec.log.Debug(logs.DeleteTombstoneStructureSuccessfullyFormedSaving)
exec.saveTombstone(ctx)
}
@ -27,7 +28,7 @@ func (exec *execCtx) formTombstone(ctx context.Context) (ok bool) {
exec.status = statusUndefined
exec.err = err
exec.log.Debug("could not read tombstone lifetime config",
exec.log.Debug(logs.DeleteCouldNotReadTombstoneLifetimeConfig,
zap.String("error", err.Error()),
)
@ -40,14 +41,14 @@ func (exec *execCtx) formTombstone(ctx context.Context) (ok bool) {
)
exec.addMembers([]oid.ID{exec.address().Object()})
exec.log.Debug("forming split info...")
exec.log.Debug(logs.DeleteFormingSplitInfo)
ok = exec.formSplitInfo(ctx)
if !ok {
return
}
exec.log.Debug("split info successfully formed, collecting members...")
exec.log.Debug(logs.DeleteSplitInfoSuccessfullyFormedCollectingMembers)
exec.tombstone.SetSplitID(exec.splitInfo.SplitID())
@ -56,7 +57,7 @@ func (exec *execCtx) formTombstone(ctx context.Context) (ok bool) {
return
}
exec.log.Debug("members successfully collected")
exec.log.Debug(logs.DeleteMembersSuccessfullyCollected)
ok = exec.initTombstoneObject()
if !ok {