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 /light/txpool.go | |
parent | 47af53f9aaf9aa7b12cd976eb150ccf3d64da6fd (diff) | |
download | go-tangerine-d4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851.tar go-tangerine-d4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851.tar.gz go-tangerine-d4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851.tar.bz2 go-tangerine-d4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851.tar.lz go-tangerine-d4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851.tar.xz go-tangerine-d4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851.tar.zst go-tangerine-d4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851.zip |
all: blidly swap out glog to our log15, logs need rework
Diffstat (limited to 'light/txpool.go')
-rw-r--r-- | light/txpool.go | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/light/txpool.go b/light/txpool.go index bcdb6123d..365f02d25 100644 --- a/light/txpool.go +++ b/light/txpool.go @@ -26,8 +26,7 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/event" - "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" "github.com/ethereum/go-ethereum/rlp" "golang.org/x/net/context" @@ -321,7 +320,7 @@ func (pool *TxPool) eventLoop() { func (pool *TxPool) Stop() { close(pool.quit) pool.events.Unsubscribe() - glog.V(logger.Info).Infoln("Transaction pool stopped") + log.Info(fmt.Sprint("Transaction pool stopped")) } // Stats returns the number of currently pending (locally created) transactions @@ -417,7 +416,7 @@ func (self *TxPool) add(ctx context.Context, tx *types.Transaction) error { go self.eventMux.Post(core.TxPreEvent{Tx: tx}) } - if glog.V(logger.Debug) { + log.Debug("", "msg", log.Lazy{Fn: func() string { var toname string if to := tx.To(); to != nil { toname = common.Bytes2Hex(to[:4]) @@ -428,8 +427,8 @@ func (self *TxPool) add(ctx context.Context, tx *types.Transaction) error { // verified in ValidateTransaction. f, _ := types.Sender(self.signer, tx) from := common.Bytes2Hex(f[:4]) - glog.Infof("(t) %x => %s (%v) %x\n", from, toname, tx.Value, hash) - } + return fmt.Sprintf("(t) %x => %s (%v) %x\n", from, toname, tx.Value(), hash) + }}) return nil } @@ -464,11 +463,11 @@ func (self *TxPool) AddBatch(ctx context.Context, txs []*types.Transaction) { for _, tx := range txs { if err := self.add(ctx, tx); err != nil { - glog.V(logger.Debug).Infoln("tx error:", err) + log.Debug(fmt.Sprint("tx error:", err)) } else { sendTx = append(sendTx, tx) h := tx.Hash() - glog.V(logger.Debug).Infof("tx %x\n", h[:4]) + log.Debug(fmt.Sprintf("tx %x\n", h[:4])) } } |