aboutsummaryrefslogtreecommitdiffstats
path: root/core/state
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-02-28 22:55:37 +0800
committerGitHub <noreply@github.com>2017-02-28 22:55:37 +0800
commit94c71c171f6c4de1f6f041bf1aadef2a377e10a3 (patch)
treedd4a0ddcc1f41268ab22eb50e5d0329855ab1196 /core/state
parent5f7826270c9e87509fd7731ec64953a5e4761de0 (diff)
parentb117da2db3e2a7c557fa6f95c49aa041a973a563 (diff)
downloaddexon-94c71c171f6c4de1f6f041bf1aadef2a377e10a3.tar
dexon-94c71c171f6c4de1f6f041bf1aadef2a377e10a3.tar.gz
dexon-94c71c171f6c4de1f6f041bf1aadef2a377e10a3.tar.bz2
dexon-94c71c171f6c4de1f6f041bf1aadef2a377e10a3.tar.lz
dexon-94c71c171f6c4de1f6f041bf1aadef2a377e10a3.tar.xz
dexon-94c71c171f6c4de1f6f041bf1aadef2a377e10a3.tar.zst
dexon-94c71c171f6c4de1f6f041bf1aadef2a377e10a3.zip
Merge pull request #3723 from karalabe/logger-updates-2
Logger updates
Diffstat (limited to 'core/state')
-rw-r--r--core/state/state_object.go12
-rw-r--r--core/state/statedb.go7
2 files changed, 2 insertions, 17 deletions
diff --git a/core/state/state_object.go b/core/state/state_object.go
index 17726dd0c..7f994ee6d 100644
--- a/core/state/state_object.go
+++ b/core/state/state_object.go
@@ -24,7 +24,6 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
- "github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/rlp"
"github.com/ethereum/go-ethereum/trie"
)
@@ -134,9 +133,6 @@ func (self *stateObject) markSuicided() {
self.onDirty(self.Address())
self.onDirty = nil
}
- log.Debug("", "msg", log.Lazy{Fn: func() string {
- return fmt.Sprintf("%x: #%d %v X\n", self.Address(), self.Nonce(), self.Balance())
- }})
}
func (c *stateObject) touch() {
@@ -251,10 +247,6 @@ func (c *stateObject) AddBalance(amount *big.Int) {
return
}
c.SetBalance(new(big.Int).Add(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 removes amount from c's balance.
@@ -264,10 +256,6 @@ func (c *stateObject) SubBalance(amount *big.Int) {
return
}
c.SetBalance(new(big.Int).Sub(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)
- }})
}
func (self *stateObject) SetBalance(amount *big.Int) {
diff --git a/core/state/statedb.go b/core/state/statedb.go
index a87607a25..cfd033bd8 100644
--- a/core/state/statedb.go
+++ b/core/state/statedb.go
@@ -410,7 +410,7 @@ func (self *StateDB) getStateObject(addr common.Address) (stateObject *stateObje
}
var data Account
if err := rlp.DecodeBytes(enc, &data); err != nil {
- log.Error(fmt.Sprintf("can't decode object at %x: %v", addr[:], err))
+ log.Error("Failed to decode state object", "addr", addr, "err", err)
return nil
}
// Insert into the live set.
@@ -445,9 +445,6 @@ func (self *StateDB) createObject(addr common.Address) (newobj, prev *stateObjec
newobj = newObject(self, addr, Account{}, self.MarkStateObjectDirty)
newobj.setNonce(0) // sets the object to dirty
if prev == nil {
- log.Debug("", "msg", log.Lazy{Fn: func() string {
- return fmt.Sprintf("(+) %x\n", addr)
- }})
self.journal = append(self.journal, createObjectChange{account: &addr})
} else {
self.journal = append(self.journal, resetObjectChange{prev: prev})
@@ -616,7 +613,7 @@ func (s *StateDB) CommitBatch(deleteEmptyObjects bool) (root common.Hash, batch
batch = s.db.NewBatch()
root, _ = s.commit(batch, deleteEmptyObjects)
- log.Debug(fmt.Sprintf("Trie cache stats: %d misses, %d unloads", trie.CacheMisses(), trie.CacheUnloads()))
+ log.Debug("Trie cache stats after commit", "misses", trie.CacheMisses(), "unloads", trie.CacheUnloads())
return root, batch
}