provide client version to rpc log

This commit is contained in:
Sergey Cherepanov 2023-06-13 15:32:46 +02:00
parent c753da8def
commit 38090ee68f
No known key found for this signature in database
GPG Key ID: 87F8EDE8FBDF637C

View File

@ -31,6 +31,10 @@ func PeerId(val string) zap.Field {
return zap.String("peerId", val)
}
func PeerVersion(val string) zap.Field {
return zap.String("peerVersion", val)
}
func Identity(val string) zap.Field {
return zap.String("identity", val)
}
@ -61,5 +65,5 @@ func (m *metric) RequestLog(ctx context.Context, rpc string, fields ...zap.Field
if ak != nil {
acc = ak.Account()
}
m.rpcLog.Info("", append(fields, m.appField, PeerId(peerId), Identity(acc), Method(rpc))...)
m.rpcLog.Info("", append(fields, m.appField, PeerId(peerId), Identity(acc), Method(rpc), PeerVersion(peer.CtxPeerClientVersion(ctx)))...)
}