From 5d46035ae8cfa0ae03c284a7e7d54817eb33a1f6 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Wed, 22 Dec 2021 19:19:31 +0300 Subject: [PATCH] [#1052] Tidy INFO logs Signed-off-by: Alex Vanin --- pkg/morph/event/listener.go | 4 ++-- pkg/services/policer/check.go | 4 ++-- pkg/services/replicator/process.go | 9 ++++++--- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/pkg/morph/event/listener.go b/pkg/morph/event/listener.go index a21642746..8748c6671 100644 --- a/pkg/morph/event/listener.go +++ b/pkg/morph/event/listener.go @@ -431,7 +431,7 @@ func (l listener) SetNotificationParser(pi NotificationParserInfo) { l.notificationParsers[pi.scriptHashWithType] = pi.parser() } - log.Info("registered new event parser") + log.Debug("registered new event parser") } // RegisterNotificationHandler registers the handler for particular notification event of contract. @@ -468,7 +468,7 @@ func (l listener) RegisterNotificationHandler(hi NotificationHandlerInfo) { ) l.mtx.Unlock() - log.Info("registered new event handler") + log.Debug("registered new event handler") } // EnableNotarySupport enables notary request listening. Passed hash is diff --git a/pkg/services/policer/check.go b/pkg/services/policer/check.go index 29b6e4c2c..b871a2443 100644 --- a/pkg/services/policer/check.go +++ b/pkg/services/policer/check.go @@ -98,7 +98,7 @@ func (p *Policer) processNodes(ctx context.Context, addr *object.Address, nodes if strings.Contains(err.Error(), headsvc.ErrNotFound.Error()) { continue } else { - log.Error("could not receive object header", + log.Debug("could not receive object header", zap.String("error", err.Error()), ) @@ -114,7 +114,7 @@ func (p *Policer) processNodes(ctx context.Context, addr *object.Address, nodes } if shortage > 0 { - log.Info("shortage of object copies detected", + log.Debug("shortage of object copies detected", zap.Uint32("shortage", shortage), ) diff --git a/pkg/services/replicator/process.go b/pkg/services/replicator/process.go index 825e83b19..aca81e4b8 100644 --- a/pkg/services/replicator/process.go +++ b/pkg/services/replicator/process.go @@ -45,7 +45,7 @@ func (p *Replicator) Run(ctx context.Context) { // HandleTask executes replication task inside invoking goroutine. func (p *Replicator) HandleTask(ctx context.Context, task *Task) { defer func() { - p.log.Info("finish work", + p.log.Debug("finish work", zap.Uint32("amount of unfinished replicas", task.quantity), ) }() @@ -67,7 +67,10 @@ func (p *Replicator) HandleTask(ctx context.Context, task *Task) { default: } - log := p.log.With(zap.String("node", hex.EncodeToString(task.nodes[i].PublicKey()))) + log := p.log.With( + zap.String("node", hex.EncodeToString(task.nodes[i].PublicKey())), + zap.Stringer("object", task.addr), + ) callCtx, cancel := context.WithTimeout(ctx, p.putTimeout) @@ -80,7 +83,7 @@ func (p *Replicator) HandleTask(ctx context.Context, task *Task) { zap.String("error", err.Error()), ) } else { - log.Info("object successfully replicated") + log.Debug("object successfully replicated") task.quantity-- }