From b88952467b29286bff95e64de645f1447120a075 Mon Sep 17 00:00:00 2001 From: Brian Tiger Chow Date: Thu, 30 Oct 2014 06:18:25 -0700 Subject: [PATCH] fix(everything) log.Debug -> log.Debugf --- blockservice/blockservice.go | 6 +++--- core/commands/block.go | 4 ++-- core/commands/object.go | 6 +++--- core/commands/publish.go | 2 +- daemon/daemon.go | 2 +- daemon/daemon_client.go | 2 +- diagnostics/diag.go | 4 ++-- exchange/bitswap/bitswap.go | 2 +- fuse/ipns/ipns_test.go | 4 ++-- fuse/ipns/ipns_unix.go | 16 ++++++++-------- fuse/ipns/link_unix.go | 4 ++-- fuse/readonly/readonly_unix.go | 10 +++++----- merkledag/merkledag.go | 2 +- namesys/publisher.go | 2 +- namesys/routing.go | 2 +- net/conn/conn.go | 2 +- net/swarm/swarm_test.go | 6 +++--- path/path.go | 6 +++--- pin/indirect.go | 2 +- routing/dht/dht.go | 6 +++--- routing/dht/dht_logger.go | 2 +- routing/dht/ext_test.go | 2 +- routing/dht/query.go | 20 ++++++++++---------- routing/dht/routing.go | 4 ++-- routing/kbucket/table.go | 2 +- unixfs/io/dagmodifier.go | 2 +- 26 files changed, 61 insertions(+), 61 deletions(-) diff --git a/blockservice/blockservice.go b/blockservice/blockservice.go index edfaa11faa21..8f9ae00cff1a 100644 --- a/blockservice/blockservice.go +++ b/blockservice/blockservice.go @@ -70,7 +70,7 @@ func (s *BlockService) GetBlock(ctx context.Context, k u.Key) (*blocks.Block, er log.Debugf("BlockService GetBlock: '%s'", k) datai, err := s.Datastore.Get(k.DsKey()) if err == nil { - log.Debug("Blockservice: Got data in datastore.") + log.Debugf("Blockservice: Got data in datastore.") bdata, ok := datai.([]byte) if !ok { return nil, fmt.Errorf("data associated with %s is not a []byte", k) @@ -80,14 +80,14 @@ func (s *BlockService) GetBlock(ctx context.Context, k u.Key) (*blocks.Block, er Data: bdata, }, nil } else if err == ds.ErrNotFound && s.Remote != nil { - log.Debug("Blockservice: Searching bitswap.") + log.Debugf("Blockservice: Searching bitswap.") blk, err := s.Remote.Block(ctx, k) if err != nil { return nil, err } return blk, nil } else { - log.Debug("Blockservice GetBlock: Not found.") + log.Debugf("Blockservice GetBlock: Not found.") return nil, ErrNotFound } } diff --git a/core/commands/block.go b/core/commands/block.go index 0813e9c3c880..2448d6977a65 100644 --- a/core/commands/block.go +++ b/core/commands/block.go @@ -28,7 +28,7 @@ func BlockGet(n *core.IpfsNode, args []string, opts map[string]interface{}, out } k := u.Key(h) - log.Debug("BlockGet key: '%q'", k) + log.Debugf("BlockGet key: '%q'", k) ctx, _ := context.WithTimeout(context.TODO(), time.Second*5) b, err := n.Blocks.GetBlock(ctx, k) if err != nil { @@ -48,7 +48,7 @@ func BlockPut(n *core.IpfsNode, args []string, opts map[string]interface{}, out } b := blocks.NewBlock(data) - log.Debug("BlockPut key: '%q'", b.Key()) + log.Debugf("BlockPut key: '%q'", b.Key()) k, err := n.Blocks.AddBlock(b) if err != nil { diff --git a/core/commands/object.go b/core/commands/object.go index 5d0ccddabc62..24386a173c07 100644 --- a/core/commands/object.go +++ b/core/commands/object.go @@ -19,7 +19,7 @@ func ObjectData(n *core.IpfsNode, args []string, opts map[string]interface{}, ou if err != nil { return fmt.Errorf("objectData error: %v", err) } - log.Debug("objectData: found dagnode %q (# of bytes: %d - # links: %d)", args[0], len(dagnode.Data), len(dagnode.Links)) + log.Debugf("objectData: found dagnode %q (# of bytes: %d - # links: %d)", args[0], len(dagnode.Data), len(dagnode.Links)) _, err = io.Copy(out, bytes.NewReader(dagnode.Data)) return err @@ -31,7 +31,7 @@ func ObjectLinks(n *core.IpfsNode, args []string, opts map[string]interface{}, o if err != nil { return fmt.Errorf("objectLinks error: %v", err) } - log.Debug("ObjectLinks: found dagnode %q (# of bytes: %d - # links: %d)", args[0], len(dagnode.Data), len(dagnode.Links)) + log.Debugf("ObjectLinks: found dagnode %q (# of bytes: %d - # links: %d)", args[0], len(dagnode.Data), len(dagnode.Links)) for _, link := range dagnode.Links { _, err = fmt.Fprintf(out, "%s %d %q\n", link.Hash.B58String(), link.Size, link.Name) @@ -70,7 +70,7 @@ func ObjectGet(n *core.IpfsNode, args []string, opts map[string]interface{}, out if err != nil { return fmt.Errorf("ObjectGet error: %v", err) } - log.Debug("objectGet: found dagnode %q (# of bytes: %d - # links: %d)", args[0], len(dagnode.Data), len(dagnode.Links)) + log.Debugf("objectGet: found dagnode %q (# of bytes: %d - # links: %d)", args[0], len(dagnode.Data), len(dagnode.Links)) // sadly all encodings dont implement a common interface var data []byte diff --git a/core/commands/publish.go b/core/commands/publish.go index 042f3f0c55fd..eec3762ce036 100644 --- a/core/commands/publish.go +++ b/core/commands/publish.go @@ -12,7 +12,7 @@ import ( ) func Publish(n *core.IpfsNode, args []string, opts map[string]interface{}, out io.Writer) error { - log.Debug("Begin Publish") + log.Debugf("Begin Publish") if n.Identity == nil { return errors.New("Identity not loaded!") diff --git a/daemon/daemon.go b/daemon/daemon.go index c8c150a8d163..dfddf0625ad4 100644 --- a/daemon/daemon.go +++ b/daemon/daemon.go @@ -117,7 +117,7 @@ func (dl *DaemonListener) handleConnection(conn manet.Conn) { return } - log.Debug("Got command: %v", command) + log.Debugf("Got command: %v", command) switch command.Command { case "add": err = commands.Add(dl.node, command.Args, command.Opts, conn) diff --git a/daemon/daemon_client.go b/daemon/daemon_client.go index 031d439c4a83..e894756e7f8f 100644 --- a/daemon/daemon_client.go +++ b/daemon/daemon_client.go @@ -25,7 +25,7 @@ func getDaemonAddr(confdir string) (string, error) { } fi, err := os.Open(confdir + "/rpcaddress") if err != nil { - log.Debug("getDaemonAddr failed: %s", err) + log.Debugf("getDaemonAddr failed: %s", err) if err == os.ErrNotExist { return "", ErrDaemonNotRunning } diff --git a/diagnostics/diag.go b/diagnostics/diag.go index 5cd5c2e0edc8..ff5d19698398 100644 --- a/diagnostics/diag.go +++ b/diagnostics/diag.go @@ -94,7 +94,7 @@ func newID() string { } func (d *Diagnostics) GetDiagnostic(timeout time.Duration) ([]*DiagInfo, error) { - log.Debug("Getting diagnostic.") + log.Debugf("Getting diagnostic.") ctx, _ := context.WithTimeout(context.TODO(), timeout) diagID := newID() @@ -102,7 +102,7 @@ func (d *Diagnostics) GetDiagnostic(timeout time.Duration) ([]*DiagInfo, error) d.diagMap[diagID] = time.Now() d.diagLock.Unlock() - log.Debug("Begin Diagnostic") + log.Debugf("Begin Diagnostic") peers := d.getPeers() log.Debugf("Sending diagnostic request to %d peers.", len(peers)) diff --git a/exchange/bitswap/bitswap.go b/exchange/bitswap/bitswap.go index a785b15dc4c2..ef5a79270273 100644 --- a/exchange/bitswap/bitswap.go +++ b/exchange/bitswap/bitswap.go @@ -182,7 +182,7 @@ func (bs *bitswap) ReceiveMessage(ctx context.Context, p peer.Peer, incoming bsm } defer bs.strategy.MessageSent(p, message) - log.Debug("Returning message.") + log.Debugf("Returning message.") return p, message } diff --git a/fuse/ipns/ipns_test.go b/fuse/ipns/ipns_test.go index 2d02199b982b..c52f146c79fd 100644 --- a/fuse/ipns/ipns_test.go +++ b/fuse/ipns/ipns_test.go @@ -229,10 +229,10 @@ func TestFastRepublish(t *testing.T) { fname := mnt.Dir + "/local/file" // get first resolved hash - log.Debug("publishing first hash") + log.Debugf("publishing first hash") writeFileData(t, dataA, fname) // random <-time.After(shortRepublishTimeout * 11 / 10) - log.Debug("resolving first hash") + log.Debugf("resolving first hash") resolvedHash, err := node.Namesys.Resolve(pubkeyHash) if err != nil { t.Fatal("resolve err:", pubkeyHash, err) diff --git a/fuse/ipns/ipns_unix.go b/fuse/ipns/ipns_unix.go index f056b997403c..a376ab50d4c6 100644 --- a/fuse/ipns/ipns_unix.go +++ b/fuse/ipns/ipns_unix.go @@ -163,7 +163,7 @@ func (s *Root) Lookup(name string, intr fs.Intr) (fs.Node, fuse.Error) { // ReadDir reads a particular directory. Disallowed for root. func (r *Root) ReadDir(intr fs.Intr) ([]fuse.Dirent, fuse.Error) { - log.Debug("Read Root.") + log.Debugf("Read Root.") listing := []fuse.Dirent{ fuse.Dirent{ Name: "local", @@ -276,7 +276,7 @@ func (n *Node) makeChild(name string, node *mdag.Node) *Node { // ReadDir reads the link structure as directory entries func (s *Node) ReadDir(intr fs.Intr) ([]fuse.Dirent, fuse.Error) { - log.Debug("Node ReadDir") + log.Debugf("Node ReadDir") entries := make([]fuse.Dirent, len(s.Nd.Links)) for i, link := range s.Nd.Links { n := link.Name @@ -341,7 +341,7 @@ func (n *Node) Flush(req *fuse.FlushRequest, intr fs.Intr) fuse.Error { } if n.parent != nil { - log.Debug("updating self in parent!") + log.Debugf("updating self in parent!") err := n.parent.update(n.name, newNode) if err != nil { log.Criticalf("error in updating ipns dag tree: %s", err) @@ -384,7 +384,7 @@ func (n *Node) wasChanged() { } func (n *Node) republishRoot() error { - log.Debug("Republish root") + log.Debugf("Republish root") // We should already be the root, this is just a sanity check var root *Node @@ -406,7 +406,7 @@ func (n *Node) republishRoot() error { log.Errorf("getKey error: %s", err) return err } - log.Debug("Publishing changes!") + log.Debugf("Publishing changes!") err = n.Ipfs.Namesys.Publish(root.key, ndkey.Pretty()) if err != nil { @@ -417,12 +417,12 @@ func (n *Node) republishRoot() error { } func (n *Node) Fsync(req *fuse.FsyncRequest, intr fs.Intr) fuse.Error { - log.Debug("Got fsync request!") + log.Debugf("Got fsync request!") return nil } func (n *Node) Mkdir(req *fuse.MkdirRequest, intr fs.Intr) (fs.Node, fuse.Error) { - log.Debug("Got mkdir request!") + log.Debugf("Got mkdir request!") dagnd := &mdag.Node{Data: ft.FolderPBData()} nnode := n.Nd.Copy() nnode.AddNodeLink(req.Name, dagnd) @@ -467,7 +467,7 @@ func (n *Node) Open(req *fuse.OpenRequest, resp *fuse.OpenResponse, intr fs.Intr } func (n *Node) Mknod(req *fuse.MknodRequest, intr fs.Intr) (fs.Node, fuse.Error) { - log.Debug("Got mknod request!") + log.Debugf("Got mknod request!") return nil, nil } diff --git a/fuse/ipns/link_unix.go b/fuse/ipns/link_unix.go index e81576c6e66a..5a646c58dd6a 100644 --- a/fuse/ipns/link_unix.go +++ b/fuse/ipns/link_unix.go @@ -12,13 +12,13 @@ type Link struct { } func (l *Link) Attr() fuse.Attr { - log.Debug("Link attr.") + log.Debugf("Link attr.") return fuse.Attr{ Mode: os.ModeSymlink | 0555, } } func (l *Link) Readlink(req *fuse.ReadlinkRequest, intr fs.Intr) (string, fuse.Error) { - log.Debug("ReadLink: %s", l.Target) + log.Debugf("ReadLink: %s", l.Target) return l.Target, nil } diff --git a/fuse/readonly/readonly_unix.go b/fuse/readonly/readonly_unix.go index de72a71646e0..de38bbc8827c 100644 --- a/fuse/readonly/readonly_unix.go +++ b/fuse/readonly/readonly_unix.go @@ -72,7 +72,7 @@ func (s *Root) Lookup(name string, intr fs.Intr) (fs.Node, fuse.Error) { // ReadDir reads a particular directory. Disallowed for root. func (*Root) ReadDir(intr fs.Intr) ([]fuse.Dirent, fuse.Error) { - log.Debug("Read Root.") + log.Debugf("Read Root.") return nil, fuse.EPERM } @@ -91,7 +91,7 @@ func (s *Node) loadData() error { // Attr returns the attributes of a given node. func (s *Node) Attr() fuse.Attr { - log.Debug("Node attr.") + log.Debugf("Node attr.") if s.cached == nil { s.loadData() } @@ -113,7 +113,7 @@ func (s *Node) Attr() fuse.Attr { // Lookup performs a lookup under this node. func (s *Node) Lookup(name string, intr fs.Intr) (fs.Node, fuse.Error) { - log.Debug("Lookup '%s'", name) + log.Debugf("Lookup '%s'", name) nd, err := s.Ipfs.Resolver.ResolveLinks(s.Nd, []string{name}) if err != nil { // todo: make this error more versatile. @@ -125,7 +125,7 @@ func (s *Node) Lookup(name string, intr fs.Intr) (fs.Node, fuse.Error) { // ReadDir reads the link structure as directory entries func (s *Node) ReadDir(intr fs.Intr) ([]fuse.Dirent, fuse.Error) { - log.Debug("Node ReadDir") + log.Debugf("Node ReadDir") entries := make([]fuse.Dirent, len(s.Nd.Links)) for i, link := range s.Nd.Links { n := link.Name @@ -143,7 +143,7 @@ func (s *Node) ReadDir(intr fs.Intr) ([]fuse.Dirent, fuse.Error) { // ReadAll reads the object data as file data func (s *Node) ReadAll(intr fs.Intr) ([]byte, fuse.Error) { - log.Debug("Read node.") + log.Debugf("Read node.") r, err := uio.NewDagReader(s.Nd, s.Ipfs.DAG) if err != nil { return nil, err diff --git a/merkledag/merkledag.go b/merkledag/merkledag.go index 92fa6e48efaa..3134899bd634 100644 --- a/merkledag/merkledag.go +++ b/merkledag/merkledag.go @@ -175,7 +175,7 @@ type dagService struct { // Add adds a node to the dagService, storing the block in the BlockService func (n *dagService) Add(nd *Node) (u.Key, error) { k, _ := nd.Key() - log.Debug("DagService Add [%s]", k) + log.Debugf("DagService Add [%s]", k) if n == nil { return "", fmt.Errorf("dagService is nil") } diff --git a/namesys/publisher.go b/namesys/publisher.go index 7203fb1d4a49..d95f1cbbcf98 100644 --- a/namesys/publisher.go +++ b/namesys/publisher.go @@ -27,7 +27,7 @@ func NewRoutingPublisher(route routing.IpfsRouting) Publisher { // Publish implements Publisher. Accepts a keypair and a value, func (p *ipnsPublisher) Publish(k ci.PrivKey, value string) error { - log.Debug("namesys: Publish %s", value) + log.Debugf("namesys: Publish %s", value) // validate `value` is a ref (multihash) _, err := mh.FromB58String(value) diff --git a/namesys/routing.go b/namesys/routing.go index ce1755f69249..6259705ec92c 100644 --- a/namesys/routing.go +++ b/namesys/routing.go @@ -35,7 +35,7 @@ func (r *routingResolver) CanResolve(name string) bool { // Resolve implements Resolver. Uses the IPFS routing system to resolve SFS-like // names. func (r *routingResolver) Resolve(name string) (string, error) { - log.Debug("RoutingResolve: '%s'", name) + log.Debugf("RoutingResolve: '%s'", name) ctx := context.TODO() hash, err := mh.FromB58String(name) if err != nil { diff --git a/net/conn/conn.go b/net/conn/conn.go index 3df82d15d521..eb262c9fa2a8 100644 --- a/net/conn/conn.go +++ b/net/conn/conn.go @@ -89,7 +89,7 @@ func newSingleConn(ctx context.Context, local, remote peer.Peer, // close is the internal close function, called by ContextCloser.Close func (c *singleConn) close() error { - log.Debug("%s closing Conn with %s", c.local, c.remote) + log.Debugf("%s closing Conn with %s", c.local, c.remote) // close underlying connection err := c.maconn.Close() diff --git a/net/swarm/swarm_test.go b/net/swarm/swarm_test.go index b4a9b02780a1..9fc9ab1f99cf 100644 --- a/net/swarm/swarm_test.go +++ b/net/swarm/swarm_test.go @@ -25,7 +25,7 @@ func pong(ctx context.Context, swarm *Swarm) { if bytes.Equal(m1.Data(), []byte("ping")) { m2 := msg.New(m1.Peer(), []byte("pong")) i++ - log.Debug("%s pong %s (%d)", swarm.local, m1.Peer(), i) + log.Debugf("%s pong %s (%d)", swarm.local, m1.Peer(), i) swarm.Outgoing <- m2 } } @@ -130,14 +130,14 @@ func SubtestSwarm(t *testing.T, addrs []string, MsgNum int) { for k := 0; k < MsgNum; k++ { for _, p := range *peers { - log.Debug("%s ping %s (%d)", s1.local, p, k) + log.Debugf("%s ping %s (%d)", s1.local, p, k) s1.Outgoing <- msg.New(p, []byte("ping")) } } got := map[u.Key]int{} for k := 0; k < (MsgNum * len(*peers)); k++ { - log.Debug("%s waiting for pong (%d)", s1.local, k) + log.Debugf("%s waiting for pong (%d)", s1.local, k) msg := <-s1.Incoming if string(msg.Data()) != "pong" { t.Error("unexpected conn output", msg.Data) diff --git a/path/path.go b/path/path.go index cb1061d1185e..ea57e6a5bd68 100644 --- a/path/path.go +++ b/path/path.go @@ -22,7 +22,7 @@ type Resolver struct { // path component as a hash (key) of the first node, then resolves // all other components walking the links, with ResolveLinks. func (s *Resolver) ResolvePath(fpath string) (*merkledag.Node, error) { - log.Debug("Resolve: '%s'", fpath) + log.Debugf("Resolve: '%s'", fpath) fpath = path.Clean(fpath) parts := strings.Split(fpath, "/") @@ -40,11 +40,11 @@ func (s *Resolver) ResolvePath(fpath string) (*merkledag.Node, error) { // first element in the path is a b58 hash (for now) h, err := mh.FromB58String(parts[0]) if err != nil { - log.Debug("given path element is not a base58 string.\n") + log.Debugf("given path element is not a base58 string.\n") return nil, err } - log.Debug("Resolve dag get.\n") + log.Debugf("Resolve dag get.\n") nd, err := s.DAG.Get(u.Key(h)) if err != nil { return nil, err diff --git a/pin/indirect.go b/pin/indirect.go index 2eb303de2ba6..b15b720ee751 100644 --- a/pin/indirect.go +++ b/pin/indirect.go @@ -32,7 +32,7 @@ func loadIndirPin(d ds.Datastore, k ds.Key) (*indirectPin, error) { keys = append(keys, k) refcnt[k] = v } - log.Debug("indirPin keys: %#v", keys) + log.Debugf("indirPin keys: %#v", keys) return &indirectPin{blockset: set.SimpleSetFromKeys(keys), refCounts: refcnt}, nil } diff --git a/routing/dht/dht.go b/routing/dht/dht.go index f1c42272156f..bb6cab4f6c89 100644 --- a/routing/dht/dht.go +++ b/routing/dht/dht.go @@ -259,7 +259,7 @@ func (dht *IpfsDHT) getValueOrPeers(ctx context.Context, p peer.Peer, log.Debugf("pmes.GetValue() %v", pmes.GetValue()) if value := pmes.GetValue(); value != nil { // Success! We were given the value - log.Debug("getValueOrPeers: got value") + log.Debugf("getValueOrPeers: got value") return value, nil, nil } @@ -269,7 +269,7 @@ func (dht *IpfsDHT) getValueOrPeers(ctx context.Context, p peer.Peer, if err != nil { return nil, nil, err } - log.Debug("getValueOrPeers: get from providers") + log.Debugf("getValueOrPeers: get from providers") return val, nil, nil } @@ -285,7 +285,7 @@ func (dht *IpfsDHT) getValueOrPeers(ctx context.Context, p peer.Peer, } if len(peers) > 0 { - log.Debug("getValueOrPeers: peers") + log.Debugf("getValueOrPeers: peers") return nil, peers, nil } diff --git a/routing/dht/dht_logger.go b/routing/dht/dht_logger.go index eea47ec1aebc..a6de9b028bae 100644 --- a/routing/dht/dht_logger.go +++ b/routing/dht/dht_logger.go @@ -32,7 +32,7 @@ func (l *logDhtRPC) Print() { if err != nil { log.Debugf("Error marshaling logDhtRPC object: %s", err) } else { - log.Debug(string(b)) + log.Debugf(string(b)) } } diff --git a/routing/dht/ext_test.go b/routing/dht/ext_test.go index 77684db285f5..19275338da2f 100644 --- a/routing/dht/ext_test.go +++ b/routing/dht/ext_test.go @@ -245,7 +245,7 @@ func TestNotFound(t *testing.T) { ctx, _ = context.WithTimeout(ctx, time.Second*5) v, err := d.GetValue(ctx, u.Key("hello")) - log.Debug("get value got %v", v) + log.Debugf("get value got %v", v) if err != nil { switch err { case routing.ErrNotFound: diff --git a/routing/dht/query.go b/routing/dht/query.go index 48974b8eb0aa..cd9fae98c002 100644 --- a/routing/dht/query.go +++ b/routing/dht/query.go @@ -107,7 +107,7 @@ func newQueryRunner(ctx context.Context, q *dhtQuery) *dhtQueryRunner { } func (r *dhtQueryRunner) Run(peers []peer.Peer) (*dhtQueryResult, error) { - log.Debug("Run query with %d peers.", len(peers)) + log.Debugf("Run query with %d peers.", len(peers)) if len(peers) == 0 { log.Warning("Running query with no peers!") return nil, nil @@ -176,7 +176,7 @@ func (r *dhtQueryRunner) addPeerToQuery(next peer.Peer, benchmark peer.Peer) { r.peersSeen[next.Key()] = next r.Unlock() - log.Debug("adding peer to query: %v\n", next) + log.Debugf("adding peer to query: %v\n", next) // do this after unlocking to prevent possible deadlocks. r.peersRemaining.Increment(1) @@ -200,14 +200,14 @@ func (r *dhtQueryRunner) spawnWorkers() { if !more { return // channel closed. } - log.Debug("spawning worker for: %v\n", p) + log.Debugf("spawning worker for: %v\n", p) go r.queryPeer(p) } } } func (r *dhtQueryRunner) queryPeer(p peer.Peer) { - log.Debug("spawned worker for: %v\n", p) + log.Debugf("spawned worker for: %v\n", p) // make sure we rate limit concurrency. select { @@ -218,12 +218,12 @@ func (r *dhtQueryRunner) queryPeer(p peer.Peer) { } // ok let's do this! - log.Debug("running worker for: %v", p) + log.Debugf("running worker for: %v", p) // make sure we do this when we exit defer func() { // signal we're done proccessing peer p - log.Debug("completing worker for: %v", p) + log.Debugf("completing worker for: %v", p) r.peersRemaining.Decrement(1) r.rateLimit <- struct{}{} }() @@ -232,7 +232,7 @@ func (r *dhtQueryRunner) queryPeer(p peer.Peer) { // (Incidentally, this will add it to the peerstore too) err := r.query.dialer.DialPeer(p) if err != nil { - log.Debug("ERROR worker for: %v -- err connecting: %v", p, err) + log.Debugf("ERROR worker for: %v -- err connecting: %v", p, err) r.Lock() r.errs = append(r.errs, err) r.Unlock() @@ -243,20 +243,20 @@ func (r *dhtQueryRunner) queryPeer(p peer.Peer) { res, err := r.query.qfunc(r.ctx, p) if err != nil { - log.Debug("ERROR worker for: %v %v", p, err) + log.Debugf("ERROR worker for: %v %v", p, err) r.Lock() r.errs = append(r.errs, err) r.Unlock() } else if res.success { - log.Debug("SUCCESS worker for: %v", p, res) + log.Debugf("SUCCESS worker for: %v", p, res) r.Lock() r.result = res r.Unlock() r.cancel() // signal to everyone that we're done. } else if res.closerPeers != nil { - log.Debug("PEERS CLOSER -- worker for: %v\n", p) + log.Debugf("PEERS CLOSER -- worker for: %v\n", p) for _, next := range res.closerPeers { r.addPeerToQuery(next, p) } diff --git a/routing/dht/routing.go b/routing/dht/routing.go index 44edd99a7a0b..bb11dda5ed37 100644 --- a/routing/dht/routing.go +++ b/routing/dht/routing.go @@ -54,7 +54,7 @@ func (dht *IpfsDHT) GetValue(ctx context.Context, key u.Key) ([]byte, error) { // NOTE: this might not be what we want to do... val, err := dht.getLocal(key) if err == nil { - log.Debug("Got value locally!") + log.Debugf("Got value locally!") return val, nil } @@ -247,7 +247,7 @@ func (dht *IpfsDHT) FindPeer(ctx context.Context, id peer.ID) (peer.Peer, error) return nil, err } - log.Debug("FindPeer %v %v", id, result.success) + log.Debugf("FindPeer %v %v", id, result.success) if result.peer == nil { return nil, routing.ErrNotFound } diff --git a/routing/kbucket/table.go b/routing/kbucket/table.go index 491a06c68591..8d1e94b82652 100644 --- a/routing/kbucket/table.go +++ b/routing/kbucket/table.go @@ -125,7 +125,7 @@ func copyPeersFromList(target ID, peerArr peerSorterArr, peerList *list.List) pe } peerArr = append(peerArr, &pd) if e == nil { - log.Debug("list element was nil") + log.Debugf("list element was nil") return peerArr } } diff --git a/unixfs/io/dagmodifier.go b/unixfs/io/dagmodifier.go index ebec24cfce82..2208b53c6de2 100644 --- a/unixfs/io/dagmodifier.go +++ b/unixfs/io/dagmodifier.go @@ -59,7 +59,7 @@ func (dm *DagModifier) WriteAt(b []byte, offset uint64) (int, error) { origlen := len(b) if end <= zeroblocklen { - log.Debug("Writing into zero block") + log.Debugf("Writing into zero block") // Replacing zeroeth data block (embedded in the root node) //TODO: check chunking here copy(dm.pbdata.Data[offset:], b)