mirror of https://github.com/vacp2p/nim-libp2p.git
avoid newlines in $
they mess with debug prints and logging (same reason why $(seq) doesn't print them
This commit is contained in:
parent
290ba712e9
commit
e1928456a7
|
@ -108,15 +108,10 @@ proc id*(p: PeerInfo): string {.inline.} =
|
||||||
p.peerId.pretty()
|
p.peerId.pretty()
|
||||||
|
|
||||||
proc `$`*(p: PeerInfo): string =
|
proc `$`*(p: PeerInfo): string =
|
||||||
result.add("PeerID: ")
|
result.add(p.id)
|
||||||
result.add(p.id & "\n")
|
|
||||||
|
|
||||||
if p.addrs.len > 0:
|
result.add(" ")
|
||||||
result.add("Peer Addrs: ")
|
result.add($p.addrs)
|
||||||
for a in p.addrs:
|
|
||||||
result.add($a & "\n")
|
|
||||||
|
|
||||||
if p.protocols.len > 0:
|
result.add(" ")
|
||||||
result.add("Protocols: ")
|
result.add($p.protocols)
|
||||||
for proto in p.protocols:
|
|
||||||
result.add(proto & "\n")
|
|
||||||
|
|
Loading…
Reference in New Issue