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/whisperv5/message.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/whisperv5/message.go')
-rw-r--r-- | whisper/whisperv5/message.go | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/whisper/whisperv5/message.go b/whisper/whisperv5/message.go index 255ad380d..9677f278e 100644 --- a/whisper/whisperv5/message.go +++ b/whisper/whisperv5/message.go @@ -31,8 +31,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto/ecies" - "github.com/ethereum/go-ethereum/logger" - "github.com/ethereum/go-ethereum/logger/glog" + "github.com/ethereum/go-ethereum/log" "golang.org/x/crypto/pbkdf2" ) @@ -144,7 +143,7 @@ func (msg *SentMessage) appendPadding(params *MessageParams) { func (msg *SentMessage) sign(key *ecdsa.PrivateKey) error { if isMessageSigned(msg.Raw[0]) { // this should not happen, but no reason to panic - glog.V(logger.Error).Infof("Trying to sign a message which was already signed") + log.Error(fmt.Sprintf("Trying to sign a message which was already signed")) return nil } @@ -238,7 +237,7 @@ func (msg *SentMessage) Wrap(options *MessageParams) (envelope *Envelope, err er } } if len(msg.Raw) > MaxMessageLength { - glog.V(logger.Error).Infof("Message size must not exceed %d bytes", MaxMessageLength) + log.Error(fmt.Sprintf("Message size must not exceed %d bytes", MaxMessageLength)) return nil, errors.New("Oversized message") } var salt, nonce []byte @@ -281,7 +280,7 @@ func (msg *ReceivedMessage) decryptSymmetric(key []byte, salt []byte, nonce []by } if len(nonce) != aesgcm.NonceSize() { info := fmt.Sprintf("Wrong AES nonce size - want: %d, got: %d", len(nonce), aesgcm.NonceSize()) - glog.V(logger.Error).Infof(info) + log.Error(fmt.Sprintf(info)) return errors.New(info) } decrypted, err := aesgcm.Open(nil, nonce, msg.Raw, nil) @@ -352,7 +351,7 @@ func (msg *ReceivedMessage) SigToPubKey() *ecdsa.PublicKey { pub, err := crypto.SigToPub(msg.hash(), msg.Signature) if err != nil { - glog.V(logger.Error).Infof("Could not get public key from signature: %v", err) + log.Error(fmt.Sprintf("Could not get public key from signature: %v", err)) return nil } return pub |