Skip to content

Commit

Permalink
chore: reduce log noise at default level (ethersphere#4824) (ethersph…
Browse files Browse the repository at this point in the history
  • Loading branch information
attila-lendvai authored Sep 23, 2024
1 parent 80a927a commit 10b1a4d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
3 changes: 1 addition & 2 deletions pkg/api/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,7 @@ func (s *Service) transactionResendHandler(w http.ResponseWriter, r *http.Reques

err := s.transaction.ResendTransaction(r.Context(), paths.Hash)
if err != nil {
logger.Debug("resend transaction failed", "tx_hash", paths.Hash, "error", err)
logger.Error(nil, "resend transaction failed", "tx_hash", paths.Hash)
logger.Error(nil, "resend transaction failed", "tx_hash", paths.Hash, "error", err)
if errors.Is(err, transaction.ErrUnknownTransaction) {
jsonhttp.NotFound(w, errUnknownTransaction)
} else if errors.Is(err, transaction.ErrAlreadyImported) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/postage/listener/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ func (l *listener) Listen(ctx context.Context, from uint64, updater postage.Even
events, err := l.ev.FilterLogs(ctx, l.filterQuery(big.NewInt(int64(from)), big.NewInt(int64(to))))
if err != nil {
l.metrics.BackendErrors.Inc()
l.logger.Warning("could not get logs", "error", err)
l.logger.Warning("could not get blockchain log", "error", err)
lastConfirmedBlock = 0
continue
}
Expand Down
6 changes: 2 additions & 4 deletions pkg/topology/kademlia/kademlia.go
Original file line number Diff line number Diff line change
Expand Up @@ -440,11 +440,9 @@ func (k *Kad) connectionAttemptsHandler(ctx context.Context, wg *sync.WaitGroup,
return
case errors.Is(err, p2p.ErrPeerBlocklisted):
k.logger.Debug("peer still in blocklist", "peer_address", bzzAddr)
k.logger.Warning("peer still in blocklist")
return
case err != nil:
k.logger.Debug("peer not reachable from kademlia", "peer_address", bzzAddr, "error", err)
k.logger.Warning("peer not reachable when attempting to connect")
return
}

Expand All @@ -457,7 +455,7 @@ func (k *Kad) connectionAttemptsHandler(ctx context.Context, wg *sync.WaitGroup,

k.recalcDepth()

k.logger.Info("connected to peer", "peer_address", peer.addr, "proximity_order", peer.po)
k.logger.Debug("connected to peer", "peer_address", peer.addr, "proximity_order", peer.po)
k.notifyManageLoop()
k.notifyPeerSig()
}
Expand Down Expand Up @@ -1218,7 +1216,7 @@ func (k *Kad) onConnected(ctx context.Context, addr swarm.Address) error {

// Disconnected is called when peer disconnects.
func (k *Kad) Disconnected(peer p2p.Peer) {
k.logger.Info("disconnected peer", "peer_address", peer.Address)
k.logger.Debug("disconnected peer", "peer_address", peer.Address)

k.connectedPeers.Remove(peer.Address)

Expand Down

0 comments on commit 10b1a4d

Please sign in to comment.