mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-04-10 21:03:01 +00:00
Fix/odds ticker manager log spam (#65)
* fix(odds-ticker): Reduce log spam from insufficient time warnings - Add _insufficient_time_warning_logged flag to prevent repeated warnings - Log insufficient time warning only once per display session - Reset warning flag when starting new display or updating data - Maintain debug logging for scroll position resets to aid debugging This addresses the frequent 'Not enough time to complete content display' warnings that were flooding the logs every few milliseconds. * fix(leaderboard): Reduce log spam from progress and FPS logging - Change progress logging from every 50 pixels to every 5 seconds - Increase FPS logging interval from 10 seconds to 30 seconds - Add progress_log_interval and last_progress_log_time variables - Reset progress log timer when starting new display sessions or updating data - Maintain debug capability while significantly reducing log volume This addresses the frequent 'Leaderboard progress' and 'Leaderboard FPS' messages that were flooding the logs during leaderboard scrolling. * fix(music): Reduce log spam from track update logging - Add throttling mechanism for track update logging - Log track updates only when track title changes or after 5 seconds - Track last_logged_track_title and last_track_log_time to prevent spam - Maintain debug logging for throttled updates - Apply throttling to both regular updates and first valid data logging This addresses the frequent 'Track info updated' messages that were flooding the logs every few hundred milliseconds for the same track. * fix(logo-downloader): Fix TA&M filename normalization issue - Add special case for TA&M to keep as TA&M instead of converting to TAANDM - This fixes the issue where code was looking for TAANDM.png instead of TA&M.png - The actual logo file exists as TA&M.png, so normalization was causing file not found errors - Prevents unnecessary download attempts and permission errors for existing files Fixes the error: 'Logo not found for TA&M at assets/sports/ncaa_logos/TAANDM.png' * fix(logo-downloader): Implement robust filename variation handling - Add get_logo_filename_variations() method to handle multiple filename formats - Update _load_and_resize_logo() to try filename variations before downloading - Handles cases like TA&M.png vs TAANDM.png gracefully - Maintains backward compatibility with existing normalized filenames - Prevents issues with special characters in filenames while supporting existing files This addresses the ampersand filename issue more robustly by: 1. First trying the original filename (TA&M.png) 2. Falling back to normalized filename (TAANDM.png) if needed 3. Only attempting downloads if no variations exist * fix(leaderboard): Reduce log spam from end reached messages - Add _end_reached_logged flag to prevent repeated end reached warnings - Log 'Leaderboard reached end' and 'scrolling stopped' messages only once per display session - Maintain debug logging for throttled messages to aid debugging - Reset flag when starting new display sessions or updating data - Apply same throttling pattern used in odds ticker manager This addresses the frequent 'Leaderboard reached end' and 'scrolling stopped' messages that were flooding the logs every few milliseconds when at the end.
This commit is contained in:
@@ -135,6 +135,7 @@ class OddsTickerManager:
|
||||
self.ticker_image = None # This will hold the single, wide image
|
||||
self.last_display_time = 0
|
||||
self._end_reached_logged = False # Track if we've already logged reaching the end
|
||||
self._insufficient_time_warning_logged = False # Track if we've already logged insufficient time warning
|
||||
|
||||
# Font setup
|
||||
self.fonts = self._load_fonts()
|
||||
@@ -1708,6 +1709,9 @@ class OddsTickerManager:
|
||||
self.last_update = current_time
|
||||
self.scroll_position = 0
|
||||
self.current_game_index = 0
|
||||
# Reset logging flags when updating data
|
||||
self._end_reached_logged = False
|
||||
self._insufficient_time_warning_logged = False
|
||||
self._create_ticker_image() # Create the composite image
|
||||
|
||||
if self.games_data:
|
||||
@@ -1740,6 +1744,8 @@ class OddsTickerManager:
|
||||
self.scroll_position = 0
|
||||
# Reset the end reached logging flag
|
||||
self._end_reached_logged = False
|
||||
# Reset the insufficient time warning logging flag
|
||||
self._insufficient_time_warning_logged = False
|
||||
else:
|
||||
# Check if the display start time is too old (more than 2x the dynamic duration)
|
||||
current_time = time.time()
|
||||
@@ -1750,6 +1756,8 @@ class OddsTickerManager:
|
||||
self.scroll_position = 0
|
||||
# Reset the end reached logging flag
|
||||
self._end_reached_logged = False
|
||||
# Reset the insufficient time warning logging flag
|
||||
self._insufficient_time_warning_logged = False
|
||||
|
||||
logger.debug(f"Number of games in data at start of display method: {len(self.games_data)}")
|
||||
if not self.games_data:
|
||||
@@ -1892,8 +1900,13 @@ class OddsTickerManager:
|
||||
logger.debug(f"Sufficient time remaining ({remaining_time:.1f}s) to complete scroll ({time_to_complete:.1f}s)")
|
||||
else:
|
||||
# Not enough time, reset to beginning for clean transition
|
||||
logger.warning(f"Not enough time to complete content display - remaining: {remaining_time:.1f}s, needed: {time_to_complete:.1f}s")
|
||||
logger.debug(f"Resetting scroll position for clean transition")
|
||||
# Only log this warning once per display session to avoid spam
|
||||
if not self._insufficient_time_warning_logged:
|
||||
logger.warning(f"Not enough time to complete content display - remaining: {remaining_time:.1f}s, needed: {time_to_complete:.1f}s")
|
||||
logger.debug(f"Resetting scroll position for clean transition")
|
||||
self._insufficient_time_warning_logged = True
|
||||
else:
|
||||
logger.debug(f"Resetting scroll position for clean transition (insufficient time warning already logged)")
|
||||
self.scroll_position = 0
|
||||
|
||||
# Create the visible part of the image by pasting from the ticker_image
|
||||
|
||||
Reference in New Issue
Block a user