diff --git a/abr-testing/abr_testing/data_collection/abr_robot_error.py b/abr-testing/abr_testing/data_collection/abr_robot_error.py index 2bf9abbd1a1..b42a195f52a 100644 --- a/abr-testing/abr_testing/data_collection/abr_robot_error.py +++ b/abr-testing/abr_testing/data_collection/abr_robot_error.py @@ -464,6 +464,7 @@ def get_run_error_info_from_robot( email = args.email[0] board_id = args.board_id[0] reporter_id = args.reporter_id[0] + file_paths = read_robot_logs.get_logs(storage_directory, ip) ticket = jira_tool.JiraTicket(url, api_token, email) ticket.issues_on_board(board_id) users_file_path = ticket.get_jira_users(storage_directory) @@ -496,7 +497,6 @@ def get_run_error_info_from_robot( saved_file_path_calibration, calibration = read_robot_logs.get_calibration_offsets( ip, storage_directory ) - file_paths = read_robot_logs.get_logs(storage_directory, ip) print(f"Making ticket for {summary}.") # TODO: make argument or see if I can get rid of with using board_id. diff --git a/abr-testing/abr_testing/data_collection/read_robot_logs.py b/abr-testing/abr_testing/data_collection/read_robot_logs.py index ac3636ed8a7..740adbf0cb6 100644 --- a/abr-testing/abr_testing/data_collection/read_robot_logs.py +++ b/abr-testing/abr_testing/data_collection/read_robot_logs.py @@ -569,23 +569,32 @@ def get_calibration_offsets( def get_logs(storage_directory: str, ip: str) -> List[str]: """Get Robot logs.""" - log_types = ["api.log", "server.log", "serial.log", "touchscreen.log"] + log_types: List[Dict[str, Any]] = [ + {"log type": "api.log", "records": 1000}, + {"log type": "server.log", "records": 10000}, + {"log type": "serial.log", "records": 10000}, + {"log type": "touchscreen.log", "records": 1000}, + ] all_paths = [] for log_type in log_types: try: + log_type_name = log_type["log type"] + print(log_type_name) + log_records = int(log_type["records"]) + print(log_records) response = requests.get( - f"http://{ip}:31950/logs/{log_type}", - headers={"log_identifier": log_type}, - params={"records": 5000}, + f"http://{ip}:31950/logs/{log_type_name}", + headers={"log_identifier": log_type_name}, + params={"records": log_records}, ) response.raise_for_status() log_data = response.text - log_name = ip + "_" + log_type.split(".")[0] + ".log" + log_name = ip + "_" + log_type_name.split(".")[0] + ".log" file_path = os.path.join(storage_directory, log_name) with open(file_path, mode="w", encoding="utf-8") as file: file.write(log_data) except RuntimeError: - print(f"Request exception. Did not save {log_type}") + print(f"Request exception. Did not save {log_type_name}") continue all_paths.append(file_path) # Get weston.log using scp