aboutsummaryrefslogtreecommitdiffstats
path: root/p2p/peer.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-02-22 20:10:07 +0800
committerPéter Szilágyi <peterke@gmail.com>2017-02-23 18:16:44 +0800
commitd4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851 (patch)
tree17c93170551d3eeabe2935de1765f157007f0dc2 /p2p/peer.go
parent47af53f9aaf9aa7b12cd976eb150ccf3d64da6fd (diff)
downloadgo-tangerine-d4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851.tar
go-tangerine-d4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851.tar.gz
go-tangerine-d4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851.tar.bz2
go-tangerine-d4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851.tar.lz
go-tangerine-d4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851.tar.xz
go-tangerine-d4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851.tar.zst
go-tangerine-d4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851.zip
all: blidly swap out glog to our log15, logs need rework
Diffstat (limited to 'p2p/peer.go')
-rw-r--r--p2p/peer.go19
1 files changed, 9 insertions, 10 deletions
diff --git a/p2p/peer.go b/p2p/peer.go
index b21c872d6..5d09927a5 100644
--- a/p2p/peer.go
+++ b/p2p/peer.go
@@ -25,8 +25,7 @@ import (
"sync"
"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/p2p/discover"
"github.com/ethereum/go-ethereum/rlp"
)
@@ -157,27 +156,27 @@ loop:
// A write finished. Allow the next write to start if
// there was no error.
if err != nil {
- glog.V(logger.Detail).Infof("%v: write error: %v", p, err)
+ log.Trace(fmt.Sprintf("%v: write error: %v", p, err))
reason = DiscNetworkError
break loop
}
writeStart <- struct{}{}
case err := <-readErr:
if r, ok := err.(DiscReason); ok {
- glog.V(logger.Debug).Infof("%v: remote requested disconnect: %v", p, r)
+ log.Debug(fmt.Sprintf("%v: remote requested disconnect: %v", p, r))
requested = true
reason = r
} else {
- glog.V(logger.Detail).Infof("%v: read error: %v", p, err)
+ log.Trace(fmt.Sprintf("%v: read error: %v", p, err))
reason = DiscNetworkError
}
break loop
case err := <-p.protoErr:
reason = discReasonForError(err)
- glog.V(logger.Debug).Infof("%v: protocol error: %v (%v)", p, err, reason)
+ log.Debug(fmt.Sprintf("%v: protocol error: %v (%v)", p, err, reason))
break loop
case reason = <-p.disc:
- glog.V(logger.Debug).Infof("%v: locally requested disconnect: %v", p, reason)
+ log.Debug(fmt.Sprintf("%v: locally requested disconnect: %v", p, reason))
break loop
}
}
@@ -298,14 +297,14 @@ func (p *Peer) startProtocols(writeStart <-chan struct{}, writeErr chan<- error)
proto.closed = p.closed
proto.wstart = writeStart
proto.werr = writeErr
- glog.V(logger.Detail).Infof("%v: Starting protocol %s/%d", p, proto.Name, proto.Version)
+ log.Trace(fmt.Sprintf("%v: Starting protocol %s/%d", p, proto.Name, proto.Version))
go func() {
err := proto.Run(p, proto)
if err == nil {
- glog.V(logger.Detail).Infof("%v: Protocol %s/%d returned", p, proto.Name, proto.Version)
+ log.Trace(fmt.Sprintf("%v: Protocol %s/%d returned", p, proto.Name, proto.Version))
err = errors.New("protocol returned")
} else if err != io.EOF {
- glog.V(logger.Detail).Infof("%v: Protocol %s/%d error: %v", p, proto.Name, proto.Version, err)
+ log.Trace(fmt.Sprintf("%v: Protocol %s/%d error: %v", p, proto.Name, proto.Version, err))
}
p.protoErr <- err
p.wg.Done()