provide client version to rpc log

This commit is contained in:
Sergey Cherepanov committed 2023-06-13 15:32:46 +02:00
1 parent c753da8def
commit 38090ee68f
1 file changed
+5 -1
+5 -1
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)))...)
}