Print peer IDs as escaped ascii

This commit is contained in:
Matt Joiner 2015-06-22 19:46:26 +10:00
parent 99a06e3f50
commit 859129fb28
2 changed files with 2 additions and 2 deletions

View File

@ -208,7 +208,7 @@ func (cl *Client) WriteStatus(_w io.Writer) {
} else {
fmt.Fprintln(w, "Not listening!")
}
fmt.Fprintf(w, "Peer ID: %q\n", cl.peerID)
fmt.Fprintf(w, "Peer ID: %+q\n", cl.peerID)
if cl.dHT != nil {
dhtStats := cl.dHT.Stats()
fmt.Fprintf(w, "DHT nodes: %d (%d good)\n", dhtStats.Nodes, dhtStats.GoodNodes)

View File

@ -236,7 +236,7 @@ func (cn *connection) statusFlags() (ret string) {
func (cn *connection) WriteStatus(w io.Writer, t *torrent) {
// \t isn't preserved in <pre> blocks?
fmt.Fprintf(w, "%q: %s-%s\n", cn.PeerID, cn.localAddr(), cn.remoteAddr())
fmt.Fprintf(w, "%+q: %s-%s\n", cn.PeerID, cn.localAddr(), cn.remoteAddr())
fmt.Fprintf(w, " last msg: %s, connected: %s, last useful chunk: %s\n",
eventAgeString(cn.lastMessageReceived),
eventAgeString(cn.completedHandshake),