aboutsummaryrefslogtreecommitdiffstats
path: root/whisper/whisperv5/peer.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-02-23 22:49:05 +0800
committerGitHub <noreply@github.com>2017-02-23 22:49:05 +0800
commit357732a8404c9fe4d02f041d20a0d05381a3e6d1 (patch)
treeedaf8a63eb7f7434cd9b9cbd764b3c4c3d76191e /whisper/whisperv5/peer.go
parent29fac7de448c85049a97cbec3dc0819122bd2cb0 (diff)
parentf89dd627760b43bd405cb3db1e5efdb100835db5 (diff)
downloaddexon-357732a8404c9fe4d02f041d20a0d05381a3e6d1.tar
dexon-357732a8404c9fe4d02f041d20a0d05381a3e6d1.tar.gz
dexon-357732a8404c9fe4d02f041d20a0d05381a3e6d1.tar.bz2
dexon-357732a8404c9fe4d02f041d20a0d05381a3e6d1.tar.lz
dexon-357732a8404c9fe4d02f041d20a0d05381a3e6d1.tar.xz
dexon-357732a8404c9fe4d02f041d20a0d05381a3e6d1.tar.zst
dexon-357732a8404c9fe4d02f041d20a0d05381a3e6d1.zip
Merge pull request #3696 from karalabe/contextual-logger
Contextual logger
Diffstat (limited to 'whisper/whisperv5/peer.go')
-rw-r--r--whisper/whisperv5/peer.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/whisper/whisperv5/peer.go b/whisper/whisperv5/peer.go
index 42394a0a3..e137613f5 100644
--- a/whisper/whisperv5/peer.go
+++ b/whisper/whisperv5/peer.go
@@ -21,8 +21,7 @@ import (
"time"
"github.com/ethereum/go-ethereum/common"
- "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"
"github.com/ethereum/go-ethereum/rlp"
set "gopkg.in/fatih/set.v0"
@@ -56,13 +55,13 @@ func newPeer(host *Whisper, remote *p2p.Peer, rw p2p.MsgReadWriter) *Peer {
// into the network.
func (p *Peer) start() {
go p.update()
- glog.V(logger.Debug).Infof("%v: whisper started", p.peer)
+ log.Debug(fmt.Sprintf("%v: whisper started", p.peer))
}
// stop terminates the peer updater, stopping message forwarding to it.
func (p *Peer) stop() {
close(p.quit)
- glog.V(logger.Debug).Infof("%v: whisper stopped", p.peer)
+ log.Debug(fmt.Sprintf("%v: whisper stopped", p.peer))
}
// handshake sends the protocol initiation status message to the remote peer and
@@ -111,7 +110,7 @@ func (p *Peer) update() {
case <-transmit.C:
if err := p.broadcast(); err != nil {
- glog.V(logger.Info).Infof("%v: broadcast failed: %v", p.peer, err)
+ log.Info(fmt.Sprintf("%v: broadcast failed: %v", p.peer, err))
return
}
@@ -172,7 +171,7 @@ func (p *Peer) broadcast() error {
if err := p2p.Send(p.ws, messagesCode, transmit); err != nil {
return err
}
- glog.V(logger.Detail).Infoln(p.peer, "broadcasted", len(transmit), "message(s)")
+ log.Trace(fmt.Sprint(p.peer, "broadcasted", len(transmit), "message(s)"))
return nil
}