Log disconnect/connect event

Marketing was relying on mailserver entries for checking the time a
give peer spent on the app.

This was not accurate as the assumption was that a peer would "ping" a
mailserver every 15s, which is not the case, it only hit the mailserver
as it comes from an "offline" state.

This commit changes the log level of two entries so that we have
connect/disconnect time for a given peer, which should be enough to
calculate roughly the time a peer has been online if connected to our
fleet.
This commit is contained in:
Andrea Maria Piana 2020-11-03 15:15:48 +01:00
parent 40343b3140
commit 86e0ec8e10
2 changed files with 3 additions and 3 deletions

View File

@ -1 +1 @@
0.63.0
0.63.1

View File

@ -1083,7 +1083,7 @@ func (w *Waku) HandlePeer(peer common.Peer, rw p2p.MsgReadWriter) error {
w.peers[peer] = struct{}{}
w.peerMu.Unlock()
w.logger.Debug("handling peer", zap.String("id", types.EncodeHex(peer.ID())))
w.logger.Info("handling peer", zap.String("peerID", types.EncodeHex(peer.ID())))
defer func() {
w.peerMu.Lock()
@ -1105,7 +1105,7 @@ func (w *Waku) HandlePeer(peer common.Peer, rw p2p.MsgReadWriter) error {
}
err := peer.Run()
w.logger.Debug("handled peer", zap.String("id", types.EncodeHex(peer.ID())), zap.Error(err))
w.logger.Info("handled peer", zap.String("peerID", types.EncodeHex(peer.ID())), zap.Error(err))
return err
}