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

Custom log format #1149

Closed
wants to merge 2 commits into from
Closed

Custom log format #1149

wants to merge 2 commits into from

Conversation

ceyonur
Copy link
Collaborator

@ceyonur ceyonur commented Apr 15, 2024

Why this should be merged

With the geth v1.13.2 stack loops are only available with location enabled flag is true, which changes the log format. This PR fixes it.

Before this PR logs were like:

INFO [03-29|10:05:40.152] <2ebCneCbwthjQ1rYT41nhd7M76Hc6YmosMAQrTFhBq8qeqh6tt Chain> %!v(NOFUNC): Loaded most recent local header number=826,885 hash=4cc72d..88f75e age=12h29m53s

after this PR:
[03-29|14:26:57.788] INFO <27BFHWcKjzJZstyMpN73P2GZUsVryjQcUFtd8HRQWzGvLZmxoh Chain> subnet-evm/core/blockchain.go:774 Loaded most recent local header number=0 hash=9dc18d..ef26f7 age=55y1w4d

which is more aligned with avalanchego logger i.e:

[03-29|14:26:52.021] INFO <P Chain> validators/logger.go:50 node added to validator set {"subnetID": "29uVeLPJB1eQJkzRemU8g8wZDw5uJRqpab5U2mX9euieVwiEbL", "nodeID": "NodeID-MFrZFVCXPv5iCn6M9K6XduxGTYp891xXZ", "publicKey": "0x", "txID": "vR2sz79HGcppYFoJpNsuSJ5WYVFK7usuzg3T2FxC7vEnB3z6k", "weight": 50}

How this works

There are too many unexported functions in geth's log package and if we maintain our own format we need them. This PR fetches the log/format.go from upstream and adds extra formats in format_extra.go.

How this was tested

Locally tested

How is this documented

No need

@ceyonur ceyonur requested a review from darioush as a code owner April 15, 2024 14:14
@ceyonur ceyonur self-assigned this Apr 15, 2024
@ceyonur ceyonur closed this Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

1 participant