]> git.mjollnir.org Git - moodle.git/commitdiff
debugging(): use trigger_error() when !display_errors -- now you can debug stuff...
authormartinlanghoff <martinlanghoff>
Thu, 21 Dec 2006 02:51:20 +0000 (02:51 +0000)
committermartinlanghoff <martinlanghoff>
Thu, 21 Dec 2006 02:51:20 +0000 (02:51 +0000)
lib/weblib.php

index 71dd72bcf505e85f2851e2f41ce47f5b942bb409..3f200b65d11c812505f59ef1f56618284c5e6646 100644 (file)
@@ -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;
     }