avoid newlines in $

they mess with debug prints and logging (same reason why $(seq) doesn't
print them
This commit is contained in:
Jacek Sieka 2020-04-20 15:57:06 +02:00 committed by Dmitriy Ryajov
parent 290ba712e9
commit e1928456a7
1 changed files with 5 additions and 10 deletions

View File

@ -108,15 +108,10 @@ proc id*(p: PeerInfo): string {.inline.} =
p.peerId.pretty()
proc `$`*(p: PeerInfo): string =
result.add("PeerID: ")
result.add(p.id & "\n")
result.add(p.id)
if p.addrs.len > 0:
result.add("Peer Addrs: ")
for a in p.addrs:
result.add($a & "\n")
result.add(" ")
result.add($p.addrs)
if p.protocols.len > 0:
result.add("Protocols: ")
for proto in p.protocols:
result.add(proto & "\n")
result.add(" ")
result.add($p.protocols)