-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Roman/47 gasmeter logs #498
Conversation
p0mvn
commented
Dec 19, 2023
- Add logging to gas meter
- Add filtering based on message type
func NewGasMeter(limit Gas) GasMeter { | ||
func NewGasMeter(limit Gas, logger log.Logger) GasMeter { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Breaking change
baseapp/baseapp.go
Outdated
hasSwap := false | ||
|
||
for _, m := range msgs { | ||
msgString := m.String() | ||
|
||
if strings.Contains(msgString, "MsgSwapExactAmountIn") { | ||
hasSwap = true | ||
} | ||
} | ||
|
||
// Replace logger with filter for a specific message type | ||
logerCopy := app.logger | ||
if hasSwap { | ||
app.logger = app.logger.With("sim", "info") | ||
app.logger.Info("Swap sim logger is enabled") | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logger filtering based on message type
5c7f918
to
68a6e7c
Compare
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |