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 /whisper/whisperv2/whisper.go | |
parent | 47af53f9aaf9aa7b12cd976eb150ccf3d64da6fd (diff) | |
download | go-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 'whisper/whisperv2/whisper.go')
-rw-r--r-- | whisper/whisperv2/whisper.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/whisper/whisperv2/whisper.go b/whisper/whisperv2/whisper.go index d9054959e..1d7c21bd1 100644 --- a/whisper/whisperv2/whisper.go +++ b/whisper/whisperv2/whisper.go @@ -18,6 +18,7 @@ package whisperv2 import ( "crypto/ecdsa" + "fmt" "sync" "time" @@ -25,8 +26,7 @@ import ( "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto/ecies" "github.com/ethereum/go-ethereum/event/filter" - "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/rpc" @@ -173,7 +173,7 @@ func (self *Whisper) Send(envelope *Envelope) error { // Start implements node.Service, starting the background data propagation thread // of the Whisper protocol. func (self *Whisper) Start(*p2p.Server) error { - glog.V(logger.Info).Infoln("Whisper started") + log.Info(fmt.Sprint("Whisper started")) go self.update() return nil } @@ -182,7 +182,7 @@ func (self *Whisper) Start(*p2p.Server) error { // of the Whisper protocol. func (self *Whisper) Stop() error { close(self.quit) - glog.V(logger.Info).Infoln("Whisper stopped") + log.Info(fmt.Sprint("Whisper stopped")) return nil } @@ -233,14 +233,14 @@ func (self *Whisper) handlePeer(peer *p2p.Peer, rw p2p.MsgReadWriter) error { } var envelopes []*Envelope if err := packet.Decode(&envelopes); err != nil { - glog.V(logger.Info).Infof("%v: failed to decode envelope: %v", peer, err) + log.Info(fmt.Sprintf("%v: failed to decode envelope: %v", peer, err)) continue } // Inject all envelopes into the internal pool for _, envelope := range envelopes { if err := self.add(envelope); err != nil { // TODO Punish peer here. Invalid envelope. - glog.V(logger.Debug).Infof("%v: failed to pool envelope: %v", peer, err) + log.Debug(fmt.Sprintf("%v: failed to pool envelope: %v", peer, err)) } whisperPeer.mark(envelope) } @@ -262,7 +262,7 @@ func (self *Whisper) add(envelope *Envelope) error { // Insert the message into the tracked pool hash := envelope.Hash() if _, ok := self.messages[hash]; ok { - glog.V(logger.Detail).Infof("whisper envelope already cached: %x\n", envelope) + log.Trace(fmt.Sprintf("whisper envelope already cached: %x\n", envelope)) return nil } self.messages[hash] = envelope @@ -277,7 +277,7 @@ func (self *Whisper) add(envelope *Envelope) error { // Notify the local node of a message arrival go self.postEvent(envelope) } - glog.V(logger.Detail).Infof("cached whisper envelope %x\n", envelope) + log.Trace(fmt.Sprintf("cached whisper envelope %x\n", envelope)) return nil } |