Commit 9ade8540 by Will Daly

Merge pull request #428 from edx/will/even-more-logging-and-metrics

Add info-level logging to the workflow API
parents 8e62f837 d4d53bcb
......@@ -64,6 +64,10 @@ def create_workflow(submission_uuid, steps):
try:
workflow = AssessmentWorkflow.start_workflow(submission_uuid, steps)
logger.info((
u"Started assessment workflow for "
u"submission UUID {uuid} with steps {steps}"
).format(uuid=submission_uuid, steps=steps))
return AssessmentWorkflowSerializer(workflow).data
except sub_api.SubmissionNotFoundError:
err_msg = sub_err_msg("submission not found")
......@@ -252,6 +256,10 @@ def update_from_assessments(submission_uuid, assessment_requirements):
try:
workflow.update_from_assessments(assessment_requirements)
logger.info((
u"Updated workflow for submission UUID {uuid} "
u"with requirements {reqs}"
).format(uuid=submission_uuid, reqs=assessment_requirements))
return _serialized_with_details(workflow, assessment_requirements)
except PeerAssessmentError as err:
err_msg = u"Could not update assessment workflow: {}".format(err)
......
......@@ -281,6 +281,9 @@ class AssessmentWorkflow(TimeStampedModel, StatusModel):
if self.status != new_status:
self.status = new_status
self.save()
logger.info((
u"Workflow for submission UUID {uuid} has updated status to {status}"
).format(uuid=self.submission_uuid, status=new_status))
def _get_steps(self):
"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment