Skip to content
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

Closed
wants to merge 9 commits into from
Closed

Roman/47 gasmeter logs #498

wants to merge 9 commits into from

Conversation

p0mvn
Copy link
Member

@p0mvn p0mvn commented Dec 19, 2023

  • Add logging to gas meter
  • Add filtering based on message type

Comment on lines -59 to +62
func NewGasMeter(limit Gas) GasMeter {
func NewGasMeter(limit Gas, logger log.Logger) GasMeter {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Breaking change

Comment on lines 681 to 697
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")
}

Copy link
Member Author

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

@@ -1,5 +1,10 @@
package types

import (
fmt "fmt"
reflect "reflect"

Check notice

Code scanning / CodeQL

Sensitive package import Note

Certain system packages contain functions which may be a possible source of non-determinism
Copy link

github-actions bot commented Feb 5, 2024

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.

@github-actions github-actions bot added Stale and removed Stale labels Feb 5, 2024
@czarcas7ic czarcas7ic marked this pull request as draft March 8, 2024 03:56
Copy link

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.

@github-actions github-actions bot added the Stale label Apr 23, 2024
@github-actions github-actions bot closed this Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant