provide client version to rpc log
This commit is contained in:
parent
c753da8def
commit
38090ee68f
@ -31,6 +31,10 @@ func PeerId(val string) zap.Field {
|
|||||||
return zap.String("peerId", val)
|
return zap.String("peerId", val)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func PeerVersion(val string) zap.Field {
|
||||||
|
return zap.String("peerVersion", val)
|
||||||
|
}
|
||||||
|
|
||||||
func Identity(val string) zap.Field {
|
func Identity(val string) zap.Field {
|
||||||
return zap.String("identity", val)
|
return zap.String("identity", val)
|
||||||
}
|
}
|
||||||
@ -61,5 +65,5 @@ func (m *metric) RequestLog(ctx context.Context, rpc string, fields ...zap.Field
|
|||||||
if ak != nil {
|
if ak != nil {
|
||||||
acc = ak.Account()
|
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)))...)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user