From 74a90fd12498aeb44545cfce5090eafcd7142117 Mon Sep 17 00:00:00 2001 From: Ian Norden Date: Mon, 2 Dec 2019 23:35:15 -0600 Subject: [PATCH] use Debugf instead of strconv --- libraries/shared/watcher/storage_watcher.go | 3 +-- pkg/eth/blockchain.go | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/libraries/shared/watcher/storage_watcher.go b/libraries/shared/watcher/storage_watcher.go index 0ad8a54a..813d7aa7 100644 --- a/libraries/shared/watcher/storage_watcher.go +++ b/libraries/shared/watcher/storage_watcher.go @@ -18,7 +18,6 @@ package watcher import ( "fmt" - "strconv" "time" "github.com/ethereum/go-ethereum/common" @@ -124,7 +123,7 @@ func (storageWatcher StorageWatcher) processRow(diff utils.StorageDiff) { } return } - logrus.Debug("Storage diff persisted at block height: " + strconv.Itoa(diff.BlockHeight)) + logrus.Debugf("Storage diff persisted at block height: %d", diff.BlockHeight) } func (storageWatcher StorageWatcher) processQueue() { diff --git a/pkg/eth/blockchain.go b/pkg/eth/blockchain.go index f15a607c..da88b191 100644 --- a/pkg/eth/blockchain.go +++ b/pkg/eth/blockchain.go @@ -60,7 +60,7 @@ func NewBlockChain(ethClient core.EthClient, rpcClient core.RPCClient, node core func (blockChain *BlockChain) GetBlockByNumber(blockNumber int64) (block core.Block, err error) { gethBlock, err := blockChain.ethClient.BlockByNumber(context.Background(), big.NewInt(blockNumber)) - logrus.Debug("GetBlockByNumber called with block " + strconv.Itoa(int(blockNumber))) + logrus.Debugf("GetBlockByNumber called with block %d", blockNumber) if err != nil { return block, err } @@ -77,7 +77,7 @@ func (blockChain *BlockChain) GetEthLogsWithCustomQuery(query ethereum.FilterQue } func (blockChain *BlockChain) GetHeaderByNumber(blockNumber int64) (header core.Header, err error) { - logrus.Debug("GetHeaderByNumber called with block " + strconv.Itoa(int(blockNumber))) + logrus.Debugf("GetHeaderByNumber called with block %d", blockNumber) if blockChain.node.NetworkID == core.KOVAN_NETWORK_ID { return blockChain.getPOAHeader(blockNumber) }