Add detailed logging for MLB API response and status_final games

This commit is contained in:
ChuckBuilds
2025-04-24 20:35:08 -05:00
parent 4ac6c37bab
commit a9f6889bea

View File

@@ -204,7 +204,7 @@ class BaseMLBManager:
response.raise_for_status()
data = response.json()
self.logger.debug(f"Raw API response: {data}") # Log raw response
self.logger.info(f"Raw API response: {data}") # Log raw response
games = {}
@@ -272,6 +272,12 @@ class BaseMLBManager:
[game['away_team'] for game in games.values()])
self.logger.info(f"Found teams in API response: {found_teams}")
# Log all games with status_final
final_games = [game for game in games.values() if game['status'] == 'status_final']
self.logger.info(f"Games with status_final: {len(final_games)}")
for game in final_games:
self.logger.info(f"Final game: {game['away_team']} @ {game['home_team']}")
return games
except Exception as e: