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 --- light/state_object.go | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'light/state_object.go') 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 -- cgit v1.2.3