]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Tidy up some storage logging
authorMatt Joiner <anacrolix@gmail.com>
Mon, 26 May 2025 08:39:21 +0000 (18:39 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Mon, 26 May 2025 08:39:21 +0000 (18:39 +1000)
storage/file-piece.go
webseed-peer.go

index d3e7b5ca672722b2f3c30d7dbac58fa685ecc6be..da23c4868959b27fa28a11ef2659152b82d709f0 100644 (file)
@@ -188,7 +188,7 @@ func (me *filePieceImpl) exclRenameIfExists(from, to string) (err error) {
        f.Close()
        err = os.Rename(from, to)
        if err == nil {
-               fmt.Printf("renamed %v -> %v\n", from, to)
+               me.logger().Debug("renamed file", "from", from, "to", to)
        }
        return
 }
index ae91a91fc0dc0a2591adfcf1963f363619aca760..43bb78e3a366e669895ec2bc3aef1b6da7b16f8d 100644 (file)
@@ -8,7 +8,6 @@ import (
        "iter"
        "log/slog"
        "math/rand"
-       "slices"
        "sync"
        "time"
 
@@ -234,10 +233,11 @@ func (ws *webseedPeer) inactiveRequestIndex(index RequestIndex) bool {
 
 func (ws *webseedPeer) inactiveRequests() iter.Seq[RequestIndex] {
        return func(yield func(RequestIndex) bool) {
-               sorted := slices.Sorted(ws.peer.requestState.Requests.Iterator())
-               if len(sorted) != 0 {
-                       fmt.Println("inactiveRequests", sorted)
-               }
+               // This is used to determine contiguity of requests.
+               //sorted := slices.Sorted(ws.peer.requestState.Requests.Iterator())
+               //if len(sorted) != 0 {
+               //      fmt.Println("inactiveRequests", sorted)
+               //}
                for reqIndex := range ws.peer.requestState.Requests.Iterator() {
                        if !ws.inactiveRequestIndex(reqIndex) {
                                continue