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

feat: improve log debuggability #170

Merged
merged 2 commits into from
Dec 6, 2024
Merged

feat: improve log debuggability #170

merged 2 commits into from
Dec 6, 2024

Conversation

anxolin
Copy link
Contributor

@anxolin anxolin commented Dec 5, 2024

Description

Improve logs to make them easier to debug issues.

Logs were not great, and won't be great after this PR. The goal of this PR is to improve some aspects of the logs to make it easier to debug.

It is very useful to be able to filter by block number, or by owner, or order number. Before this PR there was some context, but this context was missing in some parts, what made things like "filtering logs per block" to not work. Now all logs include the chain id and the block number.

See example:
Screenshot at Dec 05 22-17-10

Additionally, it simplifies some logger names and function names, and improve some messages so they are easier to read.

It also shows information about the number of owners and orders and how many left to process.

The PR also makes the logger utility to receive this context raw params, so we can make the logger prefix constant. Before we used to concatenate the fields, and we were not systematic with the order.

Anyways, as mentioned, logging is still not great specially in terms of code cleanness, but at least now the logs are a bit easier to debug.

@anxolin anxolin requested a review from a team December 5, 2024 22:29
@anxolin anxolin changed the title feat: improve logs feat: improve log debuggability Dec 5, 2024
@anxolin anxolin merged commit dd7eafb into main Dec 6, 2024
4 checks passed
@anxolin anxolin deleted the show-more-context-in-logs branch December 6, 2024 14:10
@github-actions github-actions bot locked and limited conversation to collaborators Dec 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants