Skip to content

Add a togglable logging window #5#6

Merged
primetime43 merged 1 commit intomainfrom
5-add-a-togglable-logging-window
Aug 16, 2025
Merged

Add a togglable logging window #5#6
primetime43 merged 1 commit intomainfrom
5-add-a-togglable-logging-window

Conversation

@primetime43
Copy link
Copy Markdown
Owner

Added logging to help the user see behind the scenes

Added logging to help the user see behind the scenes
@primetime43 primetime43 added the enhancement New feature or request label Aug 16, 2025
Copilot AI review requested due to automatic review settings August 16, 2025 06:12
@primetime43 primetime43 added the enhancement New feature or request label Aug 16, 2025
@primetime43 primetime43 linked an issue Aug 16, 2025 that may be closed by this pull request
@primetime43 primetime43 merged commit 59b864d into main Aug 16, 2025
@primetime43 primetime43 deleted the 5-add-a-togglable-logging-window branch August 16, 2025 06:12
Copy link
Copy Markdown

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 adds a toggleable logging window to the PlexPlaylistMaker GUI application, allowing users to monitor application progress and rate-limiting behavior in real-time. The changes enhance user visibility into background operations and simplify troubleshooting.

Key changes include:

  • Implementation of a live log window with GUI controls for show/hide/clear operations
  • Addition of a custom logging handler that filters connection errors and feeds logs to the GUI
  • Enhanced logging output for playlist creation with detailed statistics on matched/unmatched items

Reviewed Changes

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

File Description
README.md Updated documentation to describe the new in-app log window feature and simplified Letterboxd title parsing explanation
PlexPlaylistMakerGUI.py Added QueueHandler class, log window UI components, and keyboard shortcuts for toggling connection error logging
PlexPlaylistMakerController.py Enhanced logging output with detailed statistics and changed some log levels from INFO to DEBUG for less verbose output

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

def show_log_window(self):
if self.log_window and tk.Toplevel.winfo_exists(self.log_window):
return
self.log_window = tk.Toplevel(self)
Copy link

Copilot AI Aug 16, 2025

Choose a reason for hiding this comment

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

The method call tk.Toplevel.winfo_exists(self.log_window) is incorrect. The winfo_exists() method should be called on the instance, not the class. It should be self.log_window.winfo_exists().

Suggested change
self.log_window = tk.Toplevel(self)
def toggle_log_window(self):
if self.log_window and self.log_window.winfo_exists():
self.hide_log_window()
else:
self.show_log_window()
def show_log_window(self):
if self.log_window and self.log_window.winfo_exists():
return
self.log_window = tk.Toplevel(self)

Copilot uses AI. Check for mistakes.
def show_log_window(self):
if self.log_window and tk.Toplevel.winfo_exists(self.log_window):
return
self.log_window = tk.Toplevel(self)
Copy link

Copilot AI Aug 16, 2025

Choose a reason for hiding this comment

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

The method call tk.Toplevel.winfo_exists(self.log_window) is incorrect. The winfo_exists() method should be called on the instance, not the class. It should be self.log_window.winfo_exists().

Suggested change
self.log_window = tk.Toplevel(self)
def toggle_log_window(self):
if self.log_window and self.log_window.winfo_exists():
self.hide_log_window()
else:
self.show_log_window()
def show_log_window(self):
if self.log_window and self.log_window.winfo_exists():
return
self.log_window = tk.Toplevel(self)

Copilot uses AI. Check for mistakes.
def hide_log_window(self):
if self.log_window and tk.Toplevel.winfo_exists(self.log_window):
self.stop_log_polling()
self.log_window.destroy()
Copy link

Copilot AI Aug 16, 2025

Choose a reason for hiding this comment

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

The method call tk.Toplevel.winfo_exists(self.log_window) is incorrect. The winfo_exists() method should be called on the instance, not the class. It should be self.log_window.winfo_exists().

Suggested change
self.log_window.destroy()
if self.log_window and self.log_window.winfo_exists():
self.stop_log_polling()
self.log_window.destroy()

Copilot uses AI. Check for mistakes.
self.queue_handler.suppress_connection_errors = not self.queue_handler.suppress_connection_errors
state = 'ON' if not self.queue_handler.suppress_connection_errors else 'OFF'
# Inject an informational line so user knows the state changed
self.log_queue.put(f"[LOG FILTER] Connection error messages now {('visible' if state=='ON' else 'hidden')}.")
Copy link

Copilot AI Aug 16, 2025

Choose a reason for hiding this comment

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

The string comparison state=='ON' is fragile since state is defined as 'ON' or 'OFF' based on a boolean condition. Consider using the boolean directly: 'visible' if not self.queue_handler.suppress_connection_errors else 'hidden'.

Suggested change
self.log_queue.put(f"[LOG FILTER] Connection error messages now {('visible' if state=='ON' else 'hidden')}.")
self.queue_handler.suppress_connection_errors = not self.queue_handler.suppress_connection_errors
# Inject an informational line so user knows the state changed
self.log_queue.put(f"[LOG FILTER] Connection error messages now {'visible' if not self.queue_handler.suppress_connection_errors else 'hidden'}.")

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a togglable logging window

2 participants