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/txpool.go | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'light/txpool.go') 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])) } } -- cgit v1.2.3