Skip to content

fix logger singleton#392

Merged
bishoy-at-pieces merged 1 commit intomainfrom
fix-logger-singleton
Aug 12, 2025
Merged

fix logger singleton#392
bishoy-at-pieces merged 1 commit intomainfrom
fix-logger-singleton

Conversation

@bishoy-at-pieces
Copy link
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings August 12, 2025 14:18
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes issues with the logger singleton implementation and corrects URL formatting for localhost addresses. The changes ensure proper singleton behavior and add missing HTTP protocol prefixes.

  • Fix logger singleton pattern by setting the class instance in __init__
  • Remove slice notation when clearing logger handlers to avoid potential issues
  • Add missing "http://" protocol prefix to localhost URLs

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/pieces/logger.py Fixes singleton pattern and handler clearing logic
src/pieces/core/open_command.py Adds HTTP protocol prefix to localhost URLs

@bishoy-at-pieces bishoy-at-pieces force-pushed the fix-logger-singleton branch 2 times, most recently from 4eb0a4a to aa40918 Compare August 12, 2025 14:25
Copy link
Contributor

@mack-at-pieces mack-at-pieces left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes in this PR appear to be minor improvements and bug fixes. Here's a summary of the changes:

  • In app.py: Added EOFError to the exception handling, which is a good practice for handling terminal input.
  • In search_command.py: Changed how the query is extracted from kwargs, which may prevent potential KeyError.
  • In open_command.py: Added 'http://' to the localhost URLs, which is necessary for proper URL formatting.
  • In logger.py: Added a line to set the Logger instance, fixing a potential issue with the singleton pattern.

These changes seem to improve the robustness and correctness of the code without introducing any apparent risks. The modifications are small and focused, addressing specific issues. No security concerns are evident, and while there are no new tests, the nature of these changes doesn't necessarily require additional testing. Overall, these appear to be safe and beneficial improvements to the codebase.

@bishoy-at-pieces bishoy-at-pieces merged commit c1e4afe into main Aug 12, 2025
7 checks passed
@bishoy-at-pieces bishoy-at-pieces deleted the fix-logger-singleton branch August 12, 2025 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants