From de4d94d99e57b1522fcb2f61755caba7a5b418f9 Mon Sep 17 00:00:00 2001 From: Jonathan Fung Date: Thu, 14 Dec 2023 04:11:41 +0800 Subject: [PATCH] small fixes --- protocol/indexer/off_chain_updates/off_chain_updates.go | 2 +- protocol/lib/log/utils.go | 2 ++ protocol/x/clob/keeper/orders.go | 3 +-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/protocol/indexer/off_chain_updates/off_chain_updates.go b/protocol/indexer/off_chain_updates/off_chain_updates.go index bda99fbcf9..d2a0f62c7b 100644 --- a/protocol/indexer/off_chain_updates/off_chain_updates.go +++ b/protocol/indexer/off_chain_updates/off_chain_updates.go @@ -187,7 +187,7 @@ func CreateOrderRemoveMessage( // removed with the resulting removal status of the removed order. It attempts to look up the removal // reason using the given orderStatus & orderError. If the reason cannot be found, it logs an error // and falls back to the defaultRemovalReason. If defaultRemovalReason is ...UNSPECIFIED, it panics. -// TODO() +// TODO(CLOB-1051) take in ctx, not logger func CreateOrderRemoveMessageWithDefaultReason( logger log.Logger, orderId clobtypes.OrderId, diff --git a/protocol/lib/log/utils.go b/protocol/lib/log/utils.go index bd672295ca..18ecd75be5 100644 --- a/protocol/lib/log/utils.go +++ b/protocol/lib/log/utils.go @@ -6,10 +6,12 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) +// InfoLog reports msg as an info level log with key vals. func InfoLog(ctx sdk.Context, msg string, keyvals ...interface{}) { ctx.Logger().Info(msg, keyvals...) } +// DebugLog reports msg as a debug level log with key vals. func DebugLog(ctx sdk.Context, msg string, keyvals ...interface{}) { ctx.Logger().Debug(msg, keyvals...) } diff --git a/protocol/x/clob/keeper/orders.go b/protocol/x/clob/keeper/orders.go index 78c50f90a6..69be36e0d7 100644 --- a/protocol/x/clob/keeper/orders.go +++ b/protocol/x/clob/keeper/orders.go @@ -12,7 +12,6 @@ import ( "github.com/cometbft/cometbft/crypto/tmhash" "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/iavl/internal/logger" "github.com/dydxprotocol/v4-chain/protocol/indexer/msgsender" "github.com/dydxprotocol/v4-chain/protocol/indexer/off_chain_updates" indexershared "github.com/dydxprotocol/v4-chain/protocol/indexer/shared" @@ -460,7 +459,7 @@ func (k Keeper) PlaceStatefulOrdersFromLastBlock( ) if err != nil { - logger.Debug(ctx, + log.DebugLog(ctx, fmt.Sprintf( "MustPlaceStatefulOrdersFromLastBlock: PlaceOrder() returned an error %+v for order %+v", err,