Logging optimization #2
Open
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.
Improve Logging and Error Handling Across the Codebase
Summary
This PR enhances logging across multiple modules to improve debugging, monitoring, and error tracking. The changes ensure that log messages provide meaningful context, reduce unnecessary logs, and improve consistency across the codebase.
Changes
Enhanced Logging Structure
Improved Error Handling
fetch_live_nodes()to capture HTTP status and exceptions.Performance Optimizations
exc_info=Truefor exceptions) to avoid unnecessary string formatting.Modules Updated
logger.py: Standardized and optimized logging configuration.main.py: Improved logs for service startup and graceful shutdown.monitor.py: Enhanced logging for node status updates and availability checks.rest.py: Added informative logs for REST API requests and server lifecycle events.sql.py: Improved error handling when fetching live nodes.