MDL-76649 quiz statistics task: output more useful trace info
commit192f9939061729488ac9cbb800b9ef48ed8e33c0
authorTim Hunt <T.J.Hunt@open.ac.uk>
Mon, 12 Dec 2022 18:11:38 +0000 (12 18:11 +0000)
committerTim Hunt <T.J.Hunt@open.ac.uk>
Mon, 9 Jan 2023 13:26:41 +0000 (9 13:26 +0000)
tree36cfa0063f95517748c09cced7be6cbd5b5df699
parentb8b905cd90f7a1d0db59a70a32d47e015dcfbfea
MDL-76649 quiz statistics task: output more useful trace info

At the moment, quiz_statistics\task\recalculate gives no useful
information about what it is doing, which makes it hard to investigate
if the task fails. This commit makes it more usefully verbose.

Also, following this change, one instance of this task will not
run for more than one hour at a time.

As part of this commit, I have added a new helper mtrace_exception.
to consistently log exceptions in scheduled tasks. It is sad to
add a new function to moodlelib.php, but that seemed the logical place.
Looking at other tasks, this method is badly needed. Many are just
logging the ->getMessage() which is normaly insufficient for proper
debugging. However, swiching all existing tasks to use the new function
will need to wait for a future MDL.
lib/moodlelib.php
lib/setuplib.php
lib/upgrade.txt
mod/quiz/report/statistics/classes/task/recalculate.php