Add logging to speaking grading.

This commit is contained in:
Cristiano Ferreira
2024-05-19 15:42:31 +01:00
parent c77f7178ae
commit 070e8808b1

6
app.py
View File

@@ -369,7 +369,7 @@ def grade_speaking_task_1():
delete_files_older_than_one_day(AUDIO_FILES_PATH)
sound_file_name = AUDIO_FILES_PATH + str(uuid.uuid4())
logging.info("POST - speaking_task_1 - Received request to grade speaking task 1. "
"Use this id to track the logs: " + str(request_id))
"Use this id to track the logs: " + str(request_id) + " - Request data: " + str(request.get_json()))
try:
data = request.get_json()
question = data.get('question')
@@ -474,7 +474,7 @@ def grade_speaking_task_2():
delete_files_older_than_one_day(AUDIO_FILES_PATH)
sound_file_name = AUDIO_FILES_PATH + str(uuid.uuid4())
logging.info("POST - speaking_task_2 - Received request to grade speaking task 2. "
"Use this id to track the logs: " + str(request_id))
"Use this id to track the logs: " + str(request_id) + " - Request data: " + str(request.get_json()))
try:
data = request.get_json()
question = data.get('question')
@@ -606,7 +606,7 @@ def grade_speaking_task_3():
request_id = uuid.uuid4()
delete_files_older_than_one_day(AUDIO_FILES_PATH)
logging.info("POST - speaking_task_3 - Received request to grade speaking task 3. "
"Use this id to track the logs: " + str(request_id))
"Use this id to track the logs: " + str(request_id) + " - Request data: " + str(request.get_json()))
try:
data = request.get_json()
answers = data.get('answers')