Kaynağa Gözat

Less verbose debugging

Ben Hood 11 yıl önce
ebeveyn
işleme
ccaed4e0c1
1 değiştirilmiş dosya ile 9 ekleme ve 1 silme
  1. 9 1
      connectionpool.go

+ 9 - 1
connectionpool.go

@@ -343,7 +343,15 @@ func (c *SimplePool) Close() {
 
 func (c *SimplePool) SetHosts(hosts []HostInfo) {
 
-	fmt.Printf("Setting hosts: %+v\n", hosts)
+	if len(hosts) == 0 {
+		return
+	}
+
+	peers := make([]string, len(hosts))
+	for i, host := range hosts {
+		peers[i] = host.Peer
+	}
+	fmt.Printf("Setting peers: %+v\n", peers)
 
 	c.hostMu.Lock()
 	toRemove := make(map[string]struct{})