Fix some log levels

This commit is contained in:
Matt Joiner 2020-10-12 17:12:34 +11:00
parent d820f7861c
commit 6ed1062176
2 changed files with 3 additions and 3 deletions

View File

@ -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:

View File

@ -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() {