diff options
author | Péter Szilágyi <peterke@gmail.com> | 2017-02-22 20:10:07 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2017-02-23 18:16:44 +0800 |
commit | d4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851 (patch) | |
tree | 17c93170551d3eeabe2935de1765f157007f0dc2 /swarm/network/forwarding.go | |
parent | 47af53f9aaf9aa7b12cd976eb150ccf3d64da6fd (diff) | |
download | dexon-d4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851.tar dexon-d4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851.tar.gz dexon-d4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851.tar.bz2 dexon-d4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851.tar.lz dexon-d4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851.tar.xz dexon-d4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851.tar.zst dexon-d4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851.zip |
all: blidly swap out glog to our log15, logs need rework
Diffstat (limited to 'swarm/network/forwarding.go')
-rw-r--r-- | swarm/network/forwarding.go | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/swarm/network/forwarding.go b/swarm/network/forwarding.go index fef79c70b..88a82a678 100644 --- a/swarm/network/forwarding.go +++ b/swarm/network/forwarding.go @@ -17,11 +17,11 @@ package network import ( + "fmt" "math/rand" "time" - "github.com/ethereum/go-ethereum/logger" - "github.com/ethereum/go-ethereum/logger/glog" + "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/swarm/storage" ) @@ -56,10 +56,10 @@ var searchTimeout = 3 * time.Second // logic propagating retrieve requests to peers given by the kademlia hive func (self *forwarder) Retrieve(chunk *storage.Chunk) { peers := self.hive.getPeers(chunk.Key, 0) - glog.V(logger.Detail).Infof("forwarder.Retrieve: %v - received %d peers from KΛÐΞMLIΛ...", chunk.Key.Log(), len(peers)) + log.Trace(fmt.Sprintf("forwarder.Retrieve: %v - received %d peers from KΛÐΞMLIΛ...", chunk.Key.Log(), len(peers))) OUT: for _, p := range peers { - glog.V(logger.Detail).Infof("forwarder.Retrieve: sending retrieveRequest %v to peer [%v]", chunk.Key.Log(), p) + log.Trace(fmt.Sprintf("forwarder.Retrieve: sending retrieveRequest %v to peer [%v]", chunk.Key.Log(), p)) for _, recipients := range chunk.Req.Requesters { for _, recipient := range recipients { req := recipient.(*retrieveRequestMsgData) @@ -80,7 +80,7 @@ OUT: p.retrieve(req) break OUT } - glog.V(logger.Warn).Infof("forwarder.Retrieve: unable to send retrieveRequest to peer [%v]: %v", chunk.Key.Log(), err) + log.Warn(fmt.Sprintf("forwarder.Retrieve: unable to send retrieveRequest to peer [%v]: %v", chunk.Key.Log(), err)) } } @@ -98,14 +98,14 @@ func (self *forwarder) Store(chunk *storage.Chunk) { source = chunk.Source.(*peer) } for _, p := range self.hive.getPeers(chunk.Key, 0) { - glog.V(logger.Detail).Infof("forwarder.Store: %v %v", p, chunk) + log.Trace(fmt.Sprintf("forwarder.Store: %v %v", p, chunk)) if p.syncer != nil && (source == nil || p.Addr() != source.Addr()) { n++ Deliver(p, msg, PropagateReq) } } - glog.V(logger.Detail).Infof("forwarder.Store: sent to %v peers (chunk = %v)", n, chunk) + log.Trace(fmt.Sprintf("forwarder.Store: sent to %v peers (chunk = %v)", n, chunk)) } // once a chunk is found deliver it to its requesters unless timed out @@ -123,7 +123,7 @@ func (self *forwarder) Deliver(chunk *storage.Chunk) { for id, r := range requesters { req = r.(*retrieveRequestMsgData) if req.timeout == nil || req.timeout.After(time.Now()) { - glog.V(logger.Detail).Infof("forwarder.Deliver: %v -> %v", req.Id, req.from) + log.Trace(fmt.Sprintf("forwarder.Deliver: %v -> %v", req.Id, req.from)) msg.Id = uint64(id) Deliver(req.from, msg, DeliverReq) n++ @@ -133,7 +133,7 @@ func (self *forwarder) Deliver(chunk *storage.Chunk) { } } } - glog.V(logger.Detail).Infof("forwarder.Deliver: submit chunk %v (request id %v) for delivery to %v peers", chunk.Key.Log(), id, n) + log.Trace(fmt.Sprintf("forwarder.Deliver: submit chunk %v (request id %v) for delivery to %v peers", chunk.Key.Log(), id, n)) } } |