Commit 8d928334 authored by Jeromy's avatar Jeromy
Browse files

make PeerInfo loggable

parent 9600c039
......@@ -141,6 +141,13 @@ type PeerInfo struct {
Addrs []ma.Multiaddr
}
func (pi *PeerInfo) Loggable() map[string]interface{} {
return map[string]interface{}{
"peerID": pi.ID.Pretty(),
"addrs": pi.Addrs,
}
}
func (pi *PeerInfo) MarshalJSON() ([]byte, error) {
out := make(map[string]interface{})
out["ID"] = IDB58Encode(pi.ID)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment