aboutsummaryrefslogtreecommitdiffstats
path: root/light/state_object.go
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 /light/state_object.go
parent47af53f9aaf9aa7b12cd976eb150ccf3d64da6fd (diff)
downloadgo-tangerine-d4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851.tar.gz
go-tangerine-d4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851.tar.zst
go-tangerine-d4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851.zip
all: blidly swap out glog to our log15, logs need rework
Diffstat (limited to 'light/state_object.go')
-rw-r--r--light/state_object.go21
1 files changed, 10 insertions, 11 deletions
diff --git a/light/state_object.go b/light/state_object.go
index e876c1566..03d4868cd 100644
--- a/light/state_object.go
+++ b/light/state_object.go
@@ -23,8 +23,7 @@ import (
"github.com/ethereum/go-ethereum/common"
"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"
"golang.org/x/net/context"
)
@@ -109,9 +108,9 @@ func (self *StateObject) MarkForDeletion() {
self.remove = true
self.dirty = true
- if glog.V(logger.Debug) {
- glog.Infof("%x: #%d %v X\n", self.Address(), self.nonce, self.balance)
- }
+ log.Debug("", "msg", log.Lazy{Fn: func() string {
+ return fmt.Sprintf("%x: #%d %v X\n", self.Address(), self.nonce, self.balance)
+ }})
}
// getAddr gets the storage value at the given address from the trie
@@ -158,18 +157,18 @@ func (self *StateObject) SetState(k, value common.Hash) {
func (c *StateObject) AddBalance(amount *big.Int) {
c.SetBalance(new(big.Int).Add(c.balance, amount))
- if glog.V(logger.Debug) {
- glog.Infof("%x: #%d %v (+ %v)\n", c.Address(), c.nonce, c.balance, amount)
- }
+ log.Debug("", "msg", log.Lazy{Fn: func() string {
+ return fmt.Sprintf("%x: #%d %v (+ %v)\n", c.Address(), c.nonce, c.balance, amount)
+ }})
}
// SubBalance subtracts the given amount from the account balance
func (c *StateObject) SubBalance(amount *big.Int) {
c.SetBalance(new(big.Int).Sub(c.balance, amount))
- if glog.V(logger.Debug) {
- glog.Infof("%x: #%d %v (- %v)\n", c.Address(), c.nonce, c.balance, amount)
- }
+ log.Debug("", "msg", log.Lazy{Fn: func() string {
+ return fmt.Sprintf("%x: #%d %v (- %v)\n", c.Address(), c.nonce, c.balance, amount)
+ }})
}
// SetBalance sets the account balance to the given amount