From: martinlanghoff Date: Thu, 21 Dec 2006 02:51:20 +0000 (+0000) Subject: debugging(): use trigger_error() when !display_errors -- now you can debug stuff... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=c7533061eff0058937b20531e07e40676d429786;p=moodle.git debugging(): use trigger_error() when !display_errors -- now you can debug stuff without breaking HTTP headers, HTML and JS --- 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; }