-
Notifications
You must be signed in to change notification settings - Fork 85
feat: replace isLevelEnabled guards with Pino interpolation values #4421
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
Open
belloibrahv
wants to merge
6
commits into
hiero-ledger:main
Choose a base branch
from
belloibrahv:fix/logging-interpolation-values
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat: replace isLevelEnabled guards with Pino interpolation values #4421
belloibrahv
wants to merge
6
commits into
hiero-ledger:main
from
belloibrahv:fix/logging-interpolation-values
+100
−235
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Replace simple isLevelEnabled guards with Pino interpolation values for better performance - Remove @rpcMethod trace guards since dispatcher already logs RPC method execution - Keep guards for cases requiring preprocessing (e.g., data censoring, JSON.stringify) - Use %s for string interpolation and %o for object interpolation - Improve code readability by removing unnecessary conditional logging Fixes hiero-ledger#4080 Signed-off-by: belloibrahv <[email protected]>
…n values - Convert remaining simple cases in repository files - Replace debug and trace logging with interpolation values - Maintain guards for cases requiring preprocessing - Improve logging performance and code readability Continues work on hiero-ledger#4080 Signed-off-by: belloibrahv <[email protected]>
…n values - Convert remaining simple cases in config service and eth.ts - Replace debug and trace logging with interpolation values - Maintain guards for cases requiring preprocessing (JSON.stringify, complex object access) - Continue improving logging performance and code readability Continues work on hiero-ledger#4080 Signed-off-by: belloibrahv <[email protected]>
- Remove @rpcMethod trace guards from newBlockFilter and uninstallFilter - Convert simple trace cases in repository files and commonService - Maintain guards for cases requiring preprocessing (JSON.stringify, complex object creation) - Achieve significant reduction in isLevelEnabled instances Completes work on hiero-ledger#4080 Signed-off-by: belloibrahv <[email protected]>
- Remove remaining @rpcMethod trace guards from 10+ methods in eth.ts - Convert simple interpolation cases in mirrorNodeClient.ts - Fix linting error in EVM_ADDRESS_REGEX - Achieve 68 instance reduction (134 → 66, 50.7% improvement) - All remaining 66 instances appropriately preserved for preprocessing Final comprehensive cleanup for hiero-ledger#4080 Signed-off-by: belloibrahv <[email protected]>
CRITICAL FIX: Remove trace logging from @rpcMethod methods that violates requirements - Remove trace logs from newPendingTransactionFilter() and submitWork() - Remove trace logs from getFilterLogs() and getFilterChanges() - Remove trace log from call() method - All @rpcMethod methods should NOT have trace logging per issue requirements - Dispatcher already logs RPC method execution Fixes compliance with hiero-ledger#4080 requirements Signed-off-by: belloibrahv <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR implements a comprehensive logging performance optimization by replacing
isLevelEnabled
guards with Pino's interpolation values (printf-style formatting) across the codebase. The current implementation uses JavaScript string interpolation within conditional guards, which causes performance overhead by building log messages even when the corresponding log level is disabled.Key improvements:
isLevelEnabled
instances)%s
for string interpolation and%o
for object interpolation@rpcMethod
decorated methods since the dispatcher already logs RPC method executionFiles modified: 20 files with 235 deletions and 100 insertions, demonstrating significant code cleanup.
The changes follow the approach outlined in issue #3574 and fully address the requirements of #4080, replacing simple guards while preserving necessary preprocessing cases (JSON.stringify, data censoring, complex object creation).
Related issue(s)
Fixes #4080
Testing Guide
isLevelEnabled
guards%s
and%o
placeholders correctly display string and object values respectivelyChanges from original design (optional)
N/A
Additional work needed (optional)
Checklist