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 return nil
} }
start := (1 << 14) * piece 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)])) c.post(t.newMetadataExtensionMessage(c, pp.DataMetadataExtensionMsgType, piece, t.metadataBytes[start:start+t.metadataPieceSize(piece)]))
return nil return nil
case pp.RejectMetadataExtensionMsgType: case pp.RejectMetadataExtensionMsgType:

View File

@ -392,7 +392,7 @@ func (cn *PeerConn) requestMetadataPiece(index int) {
if index < len(cn.metadataRequests) && cn.metadataRequests[index] { if index < len(cn.metadataRequests) && cn.metadataRequests[index] {
return return
} }
cn.logger.Printf("requesting metadata piece %d", index) cn.logger.WithDefaultLevel(log.Debug).Printf("requesting metadata piece %d", index)
cn.post(pp.Message{ cn.post(pp.Message{
Type: pp.Extended, Type: pp.Extended,
ExtendedID: eID, ExtendedID: eID,
@ -670,7 +670,7 @@ func (cn *PeerConn) writer(keepAliveTimeout time.Duration) {
keepAliveTimer.Reset(keepAliveTimeout) keepAliveTimer.Reset(keepAliveTimeout)
} }
if err != nil { if err != nil {
cn.logger.Printf("error writing: %v", err) cn.logger.WithDefaultLevel(log.Debug).Printf("error writing: %v", err)
return return
} }
if n != frontBuf.Len() { if n != frontBuf.Len() {