github.com/anacrolix/dht/v2 v2.0.1
github.com/anacrolix/envpprof v1.0.0
github.com/anacrolix/go-libutp v1.0.2
- github.com/anacrolix/log v0.2.2-0.20190821103111-726085c46ea1
+ github.com/anacrolix/log v0.2.2-0.20190821105323-e3efcaf1a0fd
github.com/anacrolix/missinggo v1.2.1
github.com/anacrolix/missinggo/perf v1.0.0
github.com/anacrolix/mmsg v1.0.0 // indirect
"context"
"errors"
"io"
- "log"
"sync"
+ "github.com/anacrolix/log"
"github.com/anacrolix/missinggo"
)
r.t.cl.lock()
// TODO: Just reset pieces in the readahead window. This might help
// prevent thrashing with small caches and file and piece priorities.
- log.Printf("error reading torrent %s piece %d offset %d, %d bytes: %v",
- r.t.infoHash.HexString(), pi, po, len(b1), err)
+ r.log(log.Fstr("error reading torrent %s piece %d offset %d, %d bytes: %v",
+ r.t.infoHash.HexString(), pi, po, len(b1), err))
if !r.t.updatePieceCompletion(pi) {
- log.Printf("piece %d completion unchanged", pi)
+ r.log(log.Fstr("piece %d completion unchanged", pi))
}
r.t.cl.unlock()
}
r.posChanged()
return
}
+
+func (r *reader) log(m log.Msg) {
+ r.t.logger.Log(m)
+}