diff options
author | Péter Szilágyi <peterke@gmail.com> | 2017-02-22 20:10:07 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2017-02-23 18:16:44 +0800 |
commit | d4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851 (patch) | |
tree | 17c93170551d3eeabe2935de1765f157007f0dc2 /core/vm | |
parent | 47af53f9aaf9aa7b12cd976eb150ccf3d64da6fd (diff) | |
download | dexon-d4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851.tar dexon-d4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851.tar.gz dexon-d4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851.tar.bz2 dexon-d4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851.tar.lz dexon-d4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851.tar.xz dexon-d4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851.tar.zst dexon-d4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851.zip |
all: blidly swap out glog to our log15, logs need rework
Diffstat (limited to 'core/vm')
-rw-r--r-- | core/vm/contracts.go | 8 | ||||
-rw-r--r-- | core/vm/interpreter.go | 17 |
2 files changed, 12 insertions, 13 deletions
diff --git a/core/vm/contracts.go b/core/vm/contracts.go index 1447c2cad..2793d2aa7 100644 --- a/core/vm/contracts.go +++ b/core/vm/contracts.go @@ -18,11 +18,11 @@ package vm import ( "crypto/sha256" + "fmt" "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/params" "golang.org/x/crypto/ripemd160" ) @@ -75,14 +75,14 @@ func (c *ecrecover) Run(in []byte) []byte { // tighter sig s values in homestead only apply to tx sigs if common.Bytes2Big(in[32:63]).BitLen() > 0 || !crypto.ValidateSignatureValues(v, r, s, false) { - glog.V(logger.Detail).Infof("ECRECOVER error: v, r or s value invalid") + log.Trace(fmt.Sprintf("ECRECOVER error: v, r or s value invalid")) return nil } // v needs to be at the end for libsecp256k1 pubKey, err := crypto.Ecrecover(in[:32], append(in[64:128], v)) // make sure the public key is a valid one if err != nil { - glog.V(logger.Detail).Infoln("ECRECOVER error: ", err) + log.Trace(fmt.Sprint("ECRECOVER error: ", err)) return nil } diff --git a/core/vm/interpreter.go b/core/vm/interpreter.go index 46c6befef..41f6a53f8 100644 --- a/core/vm/interpreter.go +++ b/core/vm/interpreter.go @@ -25,8 +25,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/math" "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/params" ) @@ -124,13 +123,13 @@ func (evm *Interpreter) Run(contract *Contract, input []byte) (ret []byte, err e } }() - if glog.V(logger.Debug) { - glog.Infof("evm running: %x\n", codehash[:4]) - tstart := time.Now() - defer func() { - glog.Infof("evm done: %x. time: %v\n", codehash[:4], time.Since(tstart)) - }() - } + log.Debug("", "msg", log.Lazy{Fn: func() string { + return fmt.Sprintf("evm running: %x\n", codehash[:4]) + }}) + tstart := time.Now() + defer log.Debug("", "msg", log.Lazy{Fn: func() string { + return fmt.Sprintf("evm done: %x. time: %v\n", codehash[:4], time.Since(tstart)) + }}) // The Interpreter main run loop (contextual). This loop runs until either an // explicit STOP, RETURN or SELFDESTRUCT is executed, an error occurred during |