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 /p2p/discover/database.go | |
parent | 47af53f9aaf9aa7b12cd976eb150ccf3d64da6fd (diff) | |
download | dexon-d4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851.tar dexon-d4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851.tar.gz dexon-d4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851.tar.bz2 dexon-d4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851.tar.lz dexon-d4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851.tar.xz dexon-d4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851.tar.zst dexon-d4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851.zip |
all: blidly swap out glog to our log15, logs need rework
Diffstat (limited to 'p2p/discover/database.go')
-rw-r--r-- | p2p/discover/database.go | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/p2p/discover/database.go b/p2p/discover/database.go index 8d20d1ec7..a8b32d31e 100644 --- a/p2p/discover/database.go +++ b/p2p/discover/database.go @@ -23,13 +23,13 @@ import ( "bytes" "crypto/rand" "encoding/binary" + "fmt" "os" "sync" "time" "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/logger" - "github.com/ethereum/go-ethereum/logger/glog" + "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/rlp" "github.com/syndtr/goleveldb/leveldb" "github.com/syndtr/goleveldb/leveldb/errors" @@ -180,12 +180,12 @@ func (db *nodeDB) storeInt64(key []byte, n int64) error { func (db *nodeDB) node(id NodeID) *Node { blob, err := db.lvl.Get(makeKey(id, nodeDBDiscoverRoot), nil) if err != nil { - glog.V(logger.Detail).Infof("failed to retrieve node %v: %v", id, err) + log.Trace(fmt.Sprintf("failed to retrieve node %v: %v", id, err)) return nil } node := new(Node) if err := rlp.DecodeBytes(blob, node); err != nil { - glog.V(logger.Warn).Infof("failed to decode node RLP: %v", err) + log.Warn(fmt.Sprintf("failed to decode node RLP: %v", err)) return nil } node.sha = crypto.Keccak256Hash(node.ID[:]) @@ -233,7 +233,7 @@ func (db *nodeDB) expirer() { select { case <-tick: if err := db.expireNodes(); err != nil { - glog.V(logger.Error).Infof("Failed to expire nodedb items: %v", err) + log.Error(fmt.Sprintf("Failed to expire nodedb items: %v", err)) } case <-db.quit: @@ -352,9 +352,7 @@ func nextNode(it iterator.Iterator) *Node { } var n Node if err := rlp.DecodeBytes(it.Value(), &n); err != nil { - if glog.V(logger.Warn) { - glog.Errorf("invalid node %x: %v", id, err) - } + log.Warn(fmt.Sprintf("invalid node %x: %v", id, err)) continue } return &n |