From: Matt Joiner <anacrolix@gmail.com>
Date: Mon, 12 Oct 2020 06:12:34 +0000 (+1100)
Subject: Fix some log levels
X-Git-Tag: v1.18.0~11
X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=6ed1062176e5de100fc526dd6b99310739134c89;p=btrtrc.git

Fix some log levels
---

diff --git a/client.go b/client.go
index 9bd16610..98563227 100644
--- a/client.go
+++ b/client.go
@@ -1037,7 +1037,7 @@ func (cl *Client) gotMetadataExtensionMsg(payload []byte, t *Torrent, c *PeerCon
 			return nil
 		}
 		start := (1 << 14) * piece
-		c.logger.Printf("sending metadata piece %d", piece)
+		c.logger.WithDefaultLevel(log.Debug).Printf("sending metadata piece %d", piece)
 		c.post(t.newMetadataExtensionMessage(c, pp.DataMetadataExtensionMsgType, piece, t.metadataBytes[start:start+t.metadataPieceSize(piece)]))
 		return nil
 	case pp.RejectMetadataExtensionMsgType:
diff --git a/peerconn.go b/peerconn.go
index 585cd886..cc8bdeb8 100644
--- a/peerconn.go
+++ b/peerconn.go
@@ -392,7 +392,7 @@ func (cn *PeerConn) requestMetadataPiece(index int) {
 	if index < len(cn.metadataRequests) && cn.metadataRequests[index] {
 		return
 	}
-	cn.logger.Printf("requesting metadata piece %d", index)
+	cn.logger.WithDefaultLevel(log.Debug).Printf("requesting metadata piece %d", index)
 	cn.post(pp.Message{
 		Type:       pp.Extended,
 		ExtendedID: eID,
@@ -670,7 +670,7 @@ func (cn *PeerConn) writer(keepAliveTimeout time.Duration) {
 			keepAliveTimer.Reset(keepAliveTimeout)
 		}
 		if err != nil {
-			cn.logger.Printf("error writing: %v", err)
+			cn.logger.WithDefaultLevel(log.Debug).Printf("error writing: %v", err)
 			return
 		}
 		if n != frontBuf.Len() {