forked from TrueCloudLab/frostfs-node
[#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:
parent
d29b13454f
commit
0e31c12e63
149 changed files with 1481 additions and 687 deletions
|
@ -3,6 +3,7 @@ package replicator
|
|||
import (
|
||||
"context"
|
||||
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/internal/logs"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/engine"
|
||||
putsvc "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/object/put"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/netmap"
|
||||
|
@ -20,7 +21,7 @@ type TaskResult interface {
|
|||
// Passes all the nodes that accepted the replication to the TaskResult.
|
||||
func (p *Replicator) HandleTask(ctx context.Context, task Task, res TaskResult) {
|
||||
defer func() {
|
||||
p.log.Debug("finish work",
|
||||
p.log.Debug(logs.ReplicatorFinishWork,
|
||||
zap.Uint32("amount of unfinished replicas", task.quantity),
|
||||
)
|
||||
}()
|
||||
|
@ -29,7 +30,7 @@ func (p *Replicator) HandleTask(ctx context.Context, task Task, res TaskResult)
|
|||
var err error
|
||||
task.obj, err = engine.Get(ctx, p.localStorage, task.addr)
|
||||
if err != nil {
|
||||
p.log.Error("could not get object from local storage",
|
||||
p.log.Error(logs.ReplicatorCouldNotGetObjectFromLocalStorage,
|
||||
zap.Stringer("object", task.addr),
|
||||
zap.Error(err))
|
||||
|
||||
|
@ -59,11 +60,11 @@ func (p *Replicator) HandleTask(ctx context.Context, task Task, res TaskResult)
|
|||
cancel()
|
||||
|
||||
if err != nil {
|
||||
log.Error("could not replicate object",
|
||||
log.Error(logs.ReplicatorCouldNotReplicateObject,
|
||||
zap.String("error", err.Error()),
|
||||
)
|
||||
} else {
|
||||
log.Debug("object successfully replicated")
|
||||
log.Debug(logs.ReplicatorObjectSuccessfullyReplicated)
|
||||
|
||||
task.quantity--
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue