From d4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Wed, 22 Feb 2017 14:10:07 +0200 Subject: all: blidly swap out glog to our log15, logs need rework --- trie/secure_trie.go | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'trie/secure_trie.go') diff --git a/trie/secure_trie.go b/trie/secure_trie.go index 8b90da02f..113fb6a1a 100644 --- a/trie/secure_trie.go +++ b/trie/secure_trie.go @@ -17,9 +17,10 @@ package trie import ( + "fmt" + "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" ) var secureKeyPrefix = []byte("secure-key-") @@ -70,8 +71,8 @@ func NewSecure(root common.Hash, db Database, cachelimit uint16) (*SecureTrie, e // The value bytes must not be modified by the caller. func (t *SecureTrie) Get(key []byte) []byte { res, err := t.TryGet(key) - if err != nil && glog.V(logger.Error) { - glog.Errorf("Unhandled trie error: %v", err) + if err != nil { + log.Error(fmt.Sprintf("Unhandled trie error: %v", err)) } return res } @@ -90,8 +91,8 @@ func (t *SecureTrie) TryGet(key []byte) ([]byte, error) { // The value bytes must not be modified by the caller while they are // stored in the trie. func (t *SecureTrie) Update(key, value []byte) { - if err := t.TryUpdate(key, value); err != nil && glog.V(logger.Error) { - glog.Errorf("Unhandled trie error: %v", err) + if err := t.TryUpdate(key, value); err != nil { + log.Error(fmt.Sprintf("Unhandled trie error: %v", err)) } } @@ -115,8 +116,8 @@ func (t *SecureTrie) TryUpdate(key, value []byte) error { // Delete removes any existing value for key from the trie. func (t *SecureTrie) Delete(key []byte) { - if err := t.TryDelete(key); err != nil && glog.V(logger.Error) { - glog.Errorf("Unhandled trie error: %v", err) + if err := t.TryDelete(key); err != nil { + log.Error(fmt.Sprintf("Unhandled trie error: %v", err)) } } -- cgit v1.2.3