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

Hide beacon operation field in log if it's 0 #8330

Merged
merged 5 commits into from
Feb 18, 2021

Conversation

terencechain
Copy link
Member

What type of PR is this?

Feature

What does this PR do? Why is it needed?

Hide displaying rest of the beacon fields if the count is 0

INFO blockchain: Finished applying state transition attestations=44 attesterSlashings=0 deposits=0 proposerSlashings=0 voluntaryExits=0
INFO blockchain: Finished applying state transition attestations=44 slot=3573

Which issues(s) does this PR fix?

Fixes # N/A

Other notes for review
Tried run time and it seems fine. Although non-attestations weren't involved...

@terencechain terencechain added the Discussion Simply a thread for talking about stuff label Jan 25, 2021
@terencechain terencechain self-assigned this Jan 25, 2021
@terencechain terencechain requested a review from a team as a code owner January 25, 2021 16:21
mohamedmansour
mohamedmansour previously approved these changes Jan 25, 2021
},
{name: "has attestation",
b: &ethpb.BeaconBlock{Body: &ethpb.BeaconBlockBody{Attestations: []*ethpb.Attestation{{}}}},
want: "attestations=1",
Copy link
Contributor

Choose a reason for hiding this comment

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

This only tests if the string contains attestations, maybe we should add an additional test to make sure the other ones are not there.

@potuz
Copy link
Contributor

potuz commented Jan 25, 2021

This breaks scripts that rely on the fields existing. I don't really like to have the same log message have different log structure.

If it's just a cosmetic change for the way it's printed then I think this should be applied only when the logger is stdout.

Notice that if you log to journald, you can request only nonzero fields to be printed

@terencechain
Copy link
Member Author

Updating target to v1.2.0

@terencechain terencechain added Blocked Blocked by research or external factors and removed Discussion Simply a thread for talking about stuff labels Jan 26, 2021
@terencechain terencechain modified the milestones: v1.1.1, v1.2.0 Jan 26, 2021
@rauljordan
Copy link
Contributor

Hey @terencechain whats the status on this PR?

@terencechain terencechain added Ready For Review and removed Blocked Blocked by research or external factors labels Feb 18, 2021
@terencechain
Copy link
Member Author

Ready. Let's target this for 1.3.0

@terencechain terencechain removed this from the v1.2.0 milestone Feb 18, 2021
@prylabs-bulldozer prylabs-bulldozer bot merged commit d472380 into develop Feb 18, 2021
@delete-merged-branch delete-merged-branch bot deleted the better-process-blk-logging branch February 18, 2021 19:08
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.

5 participants