aboutsummaryrefslogtreecommitdiffstats
path: root/accounts/keystore
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-02-22 20:10:07 +0800
committerPéter Szilágyi <peterke@gmail.com>2017-02-23 18:16:44 +0800
commitd4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851 (patch)
tree17c93170551d3eeabe2935de1765f157007f0dc2 /accounts/keystore
parent47af53f9aaf9aa7b12cd976eb150ccf3d64da6fd (diff)
downloadgo-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 'accounts/keystore')
-rw-r--r--accounts/keystore/account_cache.go17
-rw-r--r--accounts/keystore/watch.go10
2 files changed, 13 insertions, 14 deletions
diff --git a/accounts/keystore/account_cache.go b/accounts/keystore/account_cache.go
index 3fae3ef5b..11100ebc1 100644
--- a/accounts/keystore/account_cache.go
+++ b/accounts/keystore/account_cache.go
@@ -30,8 +30,7 @@ import (
"github.com/ethereum/go-ethereum/accounts"
"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"
)
// Minimum amount of time between cache reloads. This limit applies if the platform does
@@ -210,8 +209,8 @@ func (ac *accountCache) close() {
// Callers must hold ac.mu.
func (ac *accountCache) reload() {
accounts, err := ac.scan()
- if err != nil && glog.V(logger.Debug) {
- glog.Errorf("can't load keys: %v", err)
+ if err != nil {
+ log.Debug(fmt.Sprintf("can't load keys: %v", err))
}
ac.all = accounts
sort.Sort(ac.all)
@@ -225,7 +224,7 @@ func (ac *accountCache) reload() {
case ac.notify <- struct{}{}:
default:
}
- glog.V(logger.Debug).Infof("reloaded keys, cache has %d accounts", len(ac.all))
+ log.Debug(fmt.Sprintf("reloaded keys, cache has %d accounts", len(ac.all)))
}
func (ac *accountCache) scan() ([]accounts.Account, error) {
@@ -244,12 +243,12 @@ func (ac *accountCache) scan() ([]accounts.Account, error) {
for _, fi := range files {
path := filepath.Join(ac.keydir, fi.Name())
if skipKeyFile(fi) {
- glog.V(logger.Detail).Infof("ignoring file %s", path)
+ log.Trace(fmt.Sprintf("ignoring file %s", path))
continue
}
fd, err := os.Open(path)
if err != nil {
- glog.V(logger.Detail).Infoln(err)
+ log.Trace(fmt.Sprint(err))
continue
}
buf.Reset(fd)
@@ -259,9 +258,9 @@ func (ac *accountCache) scan() ([]accounts.Account, error) {
addr := common.HexToAddress(keyJSON.Address)
switch {
case err != nil:
- glog.V(logger.Debug).Infof("can't decode key %s: %v", path, err)
+ log.Debug(fmt.Sprintf("can't decode key %s: %v", path, err))
case (addr == common.Address{}):
- glog.V(logger.Debug).Infof("can't decode key %s: missing or zero address", path)
+ log.Debug(fmt.Sprintf("can't decode key %s: missing or zero address", path))
default:
addrs = append(addrs, accounts.Account{Address: addr, URL: accounts.URL{Scheme: KeyStoreScheme, Path: path}})
}
diff --git a/accounts/keystore/watch.go b/accounts/keystore/watch.go
index 0b4401255..ff95a7cdc 100644
--- a/accounts/keystore/watch.go
+++ b/accounts/keystore/watch.go
@@ -19,10 +19,10 @@
package keystore
import (
+ "fmt"
"time"
- "github.com/ethereum/go-ethereum/logger"
- "github.com/ethereum/go-ethereum/logger/glog"
+ "github.com/ethereum/go-ethereum/log"
"github.com/rjeczalik/notify"
)
@@ -67,12 +67,12 @@ func (w *watcher) loop() {
err := notify.Watch(w.ac.keydir, w.ev, notify.All)
if err != nil {
- glog.V(logger.Detail).Infof("can't watch %s: %v", w.ac.keydir, err)
+ log.Trace(fmt.Sprintf("can't watch %s: %v", w.ac.keydir, err))
return
}
defer notify.Stop(w.ev)
- glog.V(logger.Detail).Infof("now watching %s", w.ac.keydir)
- defer glog.V(logger.Detail).Infof("no longer watching %s", w.ac.keydir)
+ log.Trace(fmt.Sprintf("now watching %s", w.ac.keydir))
+ defer log.Trace(fmt.Sprintf("no longer watching %s", w.ac.keydir))
w.ac.mu.Lock()
w.running = true