diff options
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 } |