Moved logging to logger.Core
This commit is contained in:
parent
218bfeb60e
commit
1889727144
@ -257,8 +257,8 @@ func (sm *BlockProcessor) ValidateHeader(block, parent *types.Header) error {
|
||||
return fmt.Errorf("GasLimit check failed for block %v (%v > %v)", block.GasLimit, a, b)
|
||||
}
|
||||
|
||||
// Allow future blocks up to 4 seconds
|
||||
if int64(block.Time)+4 > time.Now().Unix() {
|
||||
// Allow future blocks up to 10 seconds
|
||||
if int64(block.Time)+10 > time.Now().Unix() {
|
||||
return BlockFutureErr
|
||||
}
|
||||
|
||||
|
@ -124,7 +124,7 @@ func (self *StateObject) MarkForDeletion() {
|
||||
self.remove = true
|
||||
self.dirty = true
|
||||
|
||||
if glog.V(logger.Debug) {
|
||||
if glog.V(logger.Core) {
|
||||
glog.Infof("%x: #%d %v X\n", self.Address(), self.nonce, self.balance)
|
||||
}
|
||||
}
|
||||
@ -190,7 +190,7 @@ func (c *StateObject) GetInstr(pc *big.Int) *common.Value {
|
||||
func (c *StateObject) AddBalance(amount *big.Int) {
|
||||
c.SetBalance(new(big.Int).Add(c.balance, amount))
|
||||
|
||||
if glog.V(logger.Debug) {
|
||||
if glog.V(logger.Core) {
|
||||
glog.Infof("%x: #%d %v (+ %v)\n", c.Address(), c.nonce, c.balance, amount)
|
||||
}
|
||||
}
|
||||
@ -198,7 +198,7 @@ func (c *StateObject) AddBalance(amount *big.Int) {
|
||||
func (c *StateObject) SubBalance(amount *big.Int) {
|
||||
c.SetBalance(new(big.Int).Sub(c.balance, amount))
|
||||
|
||||
if glog.V(logger.Debug) {
|
||||
if glog.V(logger.Core) {
|
||||
glog.Infof("%x: #%d %v (- %v)\n", c.Address(), c.nonce, c.balance, amount)
|
||||
}
|
||||
}
|
||||
@ -234,7 +234,7 @@ func (c *StateObject) ConvertGas(gas, price *big.Int) error {
|
||||
func (self *StateObject) SetGasPool(gasLimit *big.Int) {
|
||||
self.gasPool = new(big.Int).Set(gasLimit)
|
||||
|
||||
if glog.V(logger.Debug) {
|
||||
if glog.V(logger.Core) {
|
||||
glog.Infof("%x: gas (+ %v)", self.Address(), self.gasPool)
|
||||
}
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ func (self *StateDB) GetOrNewStateObject(addr common.Address) *StateObject {
|
||||
|
||||
// NewStateObject create a state object whether it exist in the trie or not
|
||||
func (self *StateDB) newStateObject(addr common.Address) *StateObject {
|
||||
if glog.V(logger.Debug) {
|
||||
if glog.V(logger.Core) {
|
||||
glog.Infof("(+) %x\n", addr)
|
||||
}
|
||||
|
||||
|
@ -8,6 +8,8 @@ import (
|
||||
"github.com/ethereum/go-ethereum/core/state"
|
||||
"github.com/ethereum/go-ethereum/core/vm"
|
||||
"github.com/ethereum/go-ethereum/crypto"
|
||||
"github.com/ethereum/go-ethereum/logger"
|
||||
"github.com/ethereum/go-ethereum/logger/glog"
|
||||
"github.com/ethereum/go-ethereum/params"
|
||||
)
|
||||
|
||||
@ -166,9 +168,6 @@ func (self *StateTransition) preCheck() (err error) {
|
||||
}
|
||||
|
||||
func (self *StateTransition) transitionState() (ret []byte, usedGas *big.Int, err error) {
|
||||
// statelogger.Debugf("(~) %x\n", self.msg.Hash())
|
||||
|
||||
// XXX Transactions after this point are considered valid.
|
||||
if err = self.preCheck(); err != nil {
|
||||
return
|
||||
}
|
||||
@ -207,7 +206,7 @@ func (self *StateTransition) transitionState() (ret []byte, usedGas *big.Int, er
|
||||
if err := self.UseGas(dataGas); err == nil {
|
||||
ref.SetCode(ret)
|
||||
} else {
|
||||
statelogger.Infoln("Insufficient gas for creating code. Require", dataGas, "and have", self.gas)
|
||||
glog.V(logger.Core).Infoln("Insufficient gas for creating code. Require", dataGas, "and have", self.gas)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@ -3,6 +3,7 @@ package logger
|
||||
const (
|
||||
Error = iota + 2
|
||||
Info
|
||||
Core
|
||||
Debug
|
||||
Detail
|
||||
)
|
||||
|
@ -168,7 +168,7 @@ func (self *Whisper) msgHandler(peer *p2p.Peer, ws p2p.MsgReadWriter) error {
|
||||
for _, envelope := range envelopes {
|
||||
if err := self.add(envelope); err != nil {
|
||||
// TODO Punish peer here. Invalid envelope.
|
||||
peer.Infoln(err)
|
||||
peer.Debugln(err)
|
||||
}
|
||||
wpeer.addKnown(envelope)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user