-
Notifications
You must be signed in to change notification settings - Fork 72
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
refactor: add log level guards to prevent unnecessary string generation #3154
refactor: add log level guards to prevent unnecessary string generation #3154
Conversation
@belloibrahv you might want to rebase, there's a lot of unrelated changes that were pulled in |
@Nana-EC, I've rebased the branch and cleaned up the PR to only include the log level guard changes. |
@belloibrahv please double check. |
a88fdab
to
5509b98
Compare
@ebadiere @quiet-node @shemnon @Nana-EC please help review my PR. Thank you |
@belloibrahv hey thanks for the good work! Looks like the DCO CI didn't pass due to this commit refactor: reduce code duplication in relay package didn't get signed off. Looking at the Details of the DCO job, it suggeests to run the commands below to fix it:
|
a08f7eb
to
1e9da7e
Compare
@ebadiere @quiet-node @shemnon @Nana-EC please help review my PR. Thank you |
heyy @belloibrahv thanks for updating the PR! However, the DCO still seems to fail. Also it seems like the PR now has some conflicts. Please Pull and resolve the conflicts. |
@Nana-EC @quiet-node @ebadiere @shemnon kindly help review the PR, Thank you. |
Hello @Nana-EC @quiet-node @ebadiere @shemnon, I ran the
I have addressed the previous Thank you for your help. |
@belloibrahv nice thanks a lot for the effort! CIs are looking so much better now! The PR Check / Title Check CI job is expected to fail and the team is working on an internal fix right now so no worries on that. The PR Label and Milestone Check should work now as I updated the milestone for the issue. The only thing we need to worry is the Tests / Tests CI looks like some tests fail. I'll take a look into this later today and will see what other approaches we can take to address them. Again thanks a lot for the patient and your contribution! Looking forward to getting this commit merged in! |
I looked into the updates, and it seems the failed tests were due to the default logging level in Pino. In the failed test suites, the logger was initialized as This is an easy fix. For each failed test suite, update the initialization as follows: - const logger = pino();
+ const logger = pino({ level: 'trace' }); This change should resolve the issue. Looks like only two suites failed because of this— Let me know if there's any other issues you're running into! Happy to help! |
@belloibrahv |
I'll make this update and verify the tests pass. |
@quiet-node, I've implemented the required changes in |
@belloibrahv could you kindly push the changes up so I can review? |
0f22ffb
to
116d642
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@belloibrahv It appears there are conflicts during the merging and rebasing that need to be resolved or reverted (see here). These conflicts are unfortunately inevitable, as the Relay is progressing rapidly with numerous contributions added daily.
I also noticed that some log messages have been updated. I suggest keeping them in their original version to avoid confusion.
Please keep me posted on how the process is going! Happy to help!
64d310a
to
2923eb7
Compare
2923eb7
to
b330271
Compare
@Nana-EC @quiet-node @ebadiere @shemnon kindly help review the PR, Thank you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for the great work!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LG.
@belloibrahv Hey wonderful work the team has reviewed the PR and approved upon it. However, the commits in this PR were signed by your GPG key. They would need to be signed with the GPG key first before it can be merged in main. Here’s a helpful resource: Signing Commits. |
7a5ea41
to
dc21c4e
Compare
Signed-off-by: belloibrahv <[email protected]>
Signed-off-by: belloibrahv <[email protected]>
dc21c4e
to
1a96789
Compare
Quality Gate passedIssues Measures |
@belloibrahv merged! Thank you once again for the excellent work! The team appreciates it and looks forward to more contributions in the future! Cheers! |
Description:
This PR optimizes logging performance by implementing proper log level guards using Pino's
isLevelEnabled
API.Changes made:
isLevelEnabled
checks before debug and trace logging callsExample of optimized logging:
Related issue(s):
Fixes #1118
Notes for reviewer:
Checklist