From f723386258345fb98ce7cbac11c5aec3a781bb87 Mon Sep 17 00:00:00 2001 From: randyahx Date: Wed, 27 Sep 2023 17:39:38 +0800 Subject: [PATCH] remove logs --- executor/executor.go | 4 ++-- monitor/monitor.go | 6 +----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/executor/executor.go b/executor/executor.go index c1444c8..0abb6de 100644 --- a/executor/executor.go +++ b/executor/executor.go @@ -125,7 +125,7 @@ func (e *Executor) GetBlockAndBlockResultAtHeight(height int64) (*tmtypes.Block, } blockResults, err := e.clients.GetClient().TmClient.BlockResults(context.Background(), &height) if err != nil { - //logging.Logger.Errorf("executor failed to get block results at height %d, err=%+v", height, err.Error()) + logging.Logger.Errorf("executor failed to get block results at height %d, err=%+v", height, err.Error()) return nil, nil, err } return block.Block, blockResults, nil @@ -136,7 +136,7 @@ func (e *Executor) GetLatestBlockHeight() (uint64, error) { res, err := client.GetLatestBlockHeight(context.Background()) latestHeight := uint64(res) if err != nil { - //logging.Logger.Errorf("executor failed to get latest block height, err=%s", err.Error()) + logging.Logger.Errorf("executor failed to get latest block height, err=%s", err.Error()) } e.mtx.Lock() diff --git a/monitor/monitor.go b/monitor/monitor.go index b3d1768..e6e9231 100644 --- a/monitor/monitor.go +++ b/monitor/monitor.go @@ -129,7 +129,7 @@ func (m *Monitor) poll() error { return err } if err = m.monitorChallengeEvents(block, blockResults); err != nil { - //logging.Logger.Errorf("encounter error when monitor challenge events at blockHeight=%d, err=%+v", nextHeight, err.Error()) + logging.Logger.Errorf("encounter error when monitor challenge events at blockHeight=%d, err=%+v", nextHeight, err.Error()) return err } return nil @@ -172,10 +172,8 @@ func (m *Monitor) monitorChallengeEvents(block *tmtypes.Block, blockResults *cty func (m *Monitor) calNextHeight() (uint64, error) { latestPolledBlock, err := m.dataProvider.GetLatestBlock() if err != nil && err != gorm.ErrRecordNotFound { - //logging.Logger.Errorf("failed to get latest block from db, error: %s", err.Error()) latestHeight, err := m.executor.GetLatestBlockHeight() if err != nil { - //logging.Logger.Errorf("failed to get latest block height, error: %s", err.Error()) return 0, err } return latestHeight, err @@ -183,7 +181,6 @@ func (m *Monitor) calNextHeight() (uint64, error) { if latestPolledBlock.Height == 0 { // a fresh database latestHeight, err := m.executor.GetLatestBlockHeight() if err != nil { - //logging.Logger.Errorf("failed to get latest block height, error: %s", err.Error()) return m.executor.GetCachedBlockHeight(), err } return latestHeight, nil @@ -192,7 +189,6 @@ func (m *Monitor) calNextHeight() (uint64, error) { latestBlockHeight, err := m.executor.GetLatestBlockHeight() if err != nil { - //logging.Logger.Errorf("failed to get latest block height, error: %s", err.Error()) return 0, err } // pauses challenger for a bit since it already caught the newest block