From 101557bb8636cf2feb1fa0c6fa092a87307b0c09 Mon Sep 17 00:00:00 2001 From: Jonathan Fung Date: Fri, 26 Jul 2024 11:08:38 -0400 Subject: [PATCH] better logs --- .../x/clob/keeper/grpc_stream_orderbook.go | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/protocol/x/clob/keeper/grpc_stream_orderbook.go b/protocol/x/clob/keeper/grpc_stream_orderbook.go index 22b087feb5..201831e283 100644 --- a/protocol/x/clob/keeper/grpc_stream_orderbook.go +++ b/protocol/x/clob/keeper/grpc_stream_orderbook.go @@ -257,12 +257,18 @@ func (k Keeper) CompareMemclobOrderbookWithLocalOrderbook( } ratio := float32(numFailed) * 100 / float32(numPassed+numFailed) - logger.Error( - fmt.Sprintf("Fill amount comparison results: %.2f failed", ratio), - "failed", numFailed, - "passed", numPassed, - "in_orderbook_not_state", numInOrderbookButNotState, - ) - - logger.Info("Orderbook comparison done!") + if numFailed+numPassed > 0 { + if numFailed > 0 { + logger.Error( + fmt.Sprintf("Fill amount comparison results: %.2f failed", ratio), + "failed", numFailed, + "passed", numPassed, + "in_orderbook_not_state", numInOrderbookButNotState, + ) + } else { + logger.Info("Orderbook comparison done successfully!") + } + } else { + logger.Info("No checks done on fill amounts.") + } }