MCPcopy Create free account
hub / github.com/CodeClash-ai/CodeClash / _parse_all_logs

Method _parse_all_logs

codeclash/viewer/app.py:910–937  ·  view source on GitHub ↗

Parse all available log files in the tournament directory (metadata only, no content)

(self)

Source from the content-addressed store, hash-verified

908 return None
909
910 def _parse_all_logs(self) -> dict[str, dict[str, str]]:
911 """Parse all available log files in the tournament directory (metadata only, no content)"""
912 all_logs = {}
913
914 # Define log files to look for
915 log_files = {"tournament.log": "Tournament Log", "game.log": "Game Log", "everything.log": "Everything Log"}
916
917 # Check for main log files
918 for log_file, display_name in log_files.items():
919 log_path = self.log_dir / log_file
920 if log_path.exists():
921 all_logs[display_name] = {"path": str(log_path)}
922
923 # Check for player logs
924 players_dir = self.log_dir / "players"
925 if players_dir.exists():
926 for player_dir in players_dir.iterdir():
927 if not player_dir.is_dir():
928 continue
929
930 player_name = player_dir.name
931 player_log = player_dir / "player.log"
932
933 if player_log.exists():
934 display_name = f"Player {player_name} Log"
935 all_logs[display_name] = {"path": str(player_log)}
936
937 return all_logs
938
939
940app = Flask(__name__)

Callers 1

parse_game_metadataMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected