Skip to content

Commit

Permalink
explicitly log out message when dispatch fails
Browse files Browse the repository at this point in the history
  • Loading branch information
teddyding committed Oct 23, 2023
1 parent cba238d commit 37dcee8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
12 changes: 11 additions & 1 deletion protocol/x/delaymsg/keeper/dispatch.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,17 @@ func DispatchMessagesForBlock(k types.DelayMsgKeeper, ctx sdk.Context) {
events = append(events, res.GetEvents()...)
return nil
}); err != nil {
k.Logger(ctx).Error("failed to execute delayed message", types.IdLogKey, id, constants.ErrorLogKey, err)
k.Logger(ctx).Error(
"failed to execute delayed message",
types.IdLogKey,
id,
constants.ErrorLogKey,
err,
types.MessageContentLogKey,
msg.String(),
types.MessageTypeUrlLogKey,
delayedMsg.Msg.TypeUrl,
)
}
}

Expand Down
4 changes: 3 additions & 1 deletion protocol/x/delaymsg/types/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,7 @@ const (

// Log
const (
IdLogKey = "id"
IdLogKey = "id"
MessageContentLogKey = "message_content"
MessageTypeUrlLogKey = "message_type_url"
)

0 comments on commit 37dcee8

Please sign in to comment.