CursorLens
CursorLens copied to clipboard
feat: unify fields as json to avoid parsing issues
Improve Log Handling and Database Storage
This PR addresses the issue reported in #23 regarding empty log.body.messages
on the logs page. The changes improve log handling, database storage, and overall code consistency.
Changes
-
Optimized JSON handling:
- Removed unnecessary JSON serialization
- Leveraged PostgreSQL's native JSON support for more efficient data storage and retrieval
-
Unified logging interface:
- Standardized the way logs are handled throughout the application
- Improved code consistency and readability
-
Updated unit tests:
- Revised LogDetails unit tests to ensure proper functionality with the new changes
-
Database migration:
- Prepared migration to change the 'headers' column type from text to json
- This change will allow for more efficient and type-safe storage of header data
Benefits
- Resolves the issue of improperly encoded log contents in the database
- Improves data integrity and retrieval efficiency
- Enhances code maintainability and readability
- Strengthens the overall reliability of the logging system
Testing
The updated unit tests cover the new changes. Please run the test suite to ensure everything is working as expected.
Next Steps
After merging this PR, monitor the logs page to confirm that log.body.messages
are now properly displayed and that there are no issues with log storage or retrieval.
Closes #23