diff options
Diffstat (limited to 'light/state_object.go')
-rw-r--r-- | light/state_object.go | 21 |
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 |