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

simulators/ethereum/engine: Trim rpc logs only at low log levels #1066

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

spencer-tb
Copy link
Contributor

Description

Forces RPC log trimming to only take affect when --sim.loglevel <= 3. I.e to get the full log we run with:
--sim.loglevel 4 or --sim.loglevel 5.

Related Issues or PRs

This PR can be regarded as an extension to following: #928

cc'ing @flcl42

Copy link
Member

@marioevz marioevz left a comment

Choose a reason for hiding this comment

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

One comment, thanks!

@@ -53,7 +54,10 @@ func (rt *LoggingRoundTrip) RoundTrip(req *http.Request) (*http.Response, error)
return nil, err
}
reqLogBytes := bytes.TrimSpace(reqBytes[:])
if len(reqLogBytes) > MAX_LOG_BYTES {

hiveLogLevel, _ := strconv.Atoi(os.Getenv("HIVE_LOGLEVEL"))
Copy link
Member

Choose a reason for hiding this comment

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

I think we could do this when instantiating the LoggingRoundTrip to not have to parse this from the env variable on every single HTTP call we do. Seems expensive.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ahh ofc! Sheesh - will change it :D

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated this in: c08b4bb

@spencer-tb spencer-tb force-pushed the simulators/ethereum/engine/helper branch from 1a8e721 to c08b4bb Compare March 27, 2024 05:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants