From c7533061eff0058937b20531e07e40676d429786 Mon Sep 17 00:00:00 2001 From: martinlanghoff Date: Thu, 21 Dec 2006 02:51:20 +0000 Subject: [PATCH] debugging(): use trigger_error() when !display_errors -- now you can debug stuff without breaking HTTP headers, HTML and JS --- lib/weblib.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/weblib.php b/lib/weblib.php index 71dd72bcf5..3f200b65d1 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -5478,7 +5478,13 @@ function debugging($message='', $level=DEBUG_NORMAL) { if ($CFG->debug >= $level) { if ($message) { - notify($message, 'notifytiny'); + if (ini_get('display_errors') == true) { + notify($message, 'notifytiny'); + } else { + // moodle debug levels constants map well to PHP's own + trigger_error($message, $level); + } + } return true; } -- 2.39.5