Skip to content

Commit

Permalink
chore: log succesful message pushes (#694)
Browse files Browse the repository at this point in the history
Co-authored-by: Prem Chaitanya Prathi <[email protected]>
  • Loading branch information
richard-ramos and chaitanyaprem authored Aug 30, 2023
1 parent 8ad08d6 commit 4c52149
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions waku/v2/protocol/filter/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,12 @@ func (wf *WakuFilterFullNode) filterListener(ctx context.Context) {
}

func (wf *WakuFilterFullNode) pushMessage(ctx context.Context, peerID peer.ID, env *protocol.Envelope) error {
logger := wf.log.With(logging.HostID("peer", peerID))
logger := wf.log.With(
logging.HostID("peer", peerID),
logging.HexBytes("envelopeHash", env.Hash()),
zap.String("pubsubTopic", env.PubsubTopic()),
zap.String("contentTopic", env.Message().ContentTopic),
)

messagePush := &pb.MessagePushV2{
PubsubTopic: env.PubsubTopic(),
Expand Down Expand Up @@ -298,12 +303,15 @@ func (wf *WakuFilterFullNode) pushMessage(ctx context.Context, peerID peer.ID, e
} else {
wf.metrics.RecordError(writeResponseFailure)
}
logger.Error("pushing messages to peer", logging.HexBytes("envelopeHash", env.Hash()), zap.String("pubsubTopic", env.PubsubTopic()), zap.String("contentTopic", env.Message().ContentTopic), zap.Error(err))
logger.Error("pushing messages to peer", zap.Error(err))
wf.subscriptions.FlagAsFailure(peerID)
return nil
}

wf.subscriptions.FlagAsSuccess(peerID)

logger.Info("message pushed succesfully") // TODO: remove or change to debug once dogfooding of filter is complete

return nil
}

Expand Down

0 comments on commit 4c52149

Please sign in to comment.