From 709dfc0687397e491f8704a9acece1fcf94e3da3 Mon Sep 17 00:00:00 2001 From: "Gerard (Gerry) Caulfield" Date: Thu, 9 Feb 2012 13:56:05 +0800 Subject: [PATCH] MDL-31552 Change add_to_log() so that it's exception handling throws a useful message when there is a problem. --- lib/datalib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/datalib.php b/lib/datalib.php index 7cc195eee75..829b3427553 100644 --- a/lib/datalib.php +++ b/lib/datalib.php @@ -1723,7 +1723,8 @@ function add_to_log($courseid, $module, $action, $url='', $info='', $cm=0, $user try { $DB->insert_record_raw('log', $log, false); } catch (dml_exception $e) { - debugging('Error: Could not insert a new entry to the Moodle log', DEBUG_ALL); + debugging('Error: Could not insert a new entry to the Moodle log. '. $e->error, DEBUG_ALL); + // MDL-11893, alert $CFG->supportemail if insert into log failed if ($CFG->supportemail and empty($CFG->noemailever)) { // email_to_user is not usable because email_to_user tries to write to the logs table,