]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Reducing the output level of log messages set to "DEBUG".
authornickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544>
Wed, 21 Oct 2009 16:09:43 +0000 (16:09 +0000)
committernickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544>
Wed, 21 Oct 2009 16:09:43 +0000 (16:09 +0000)
Debug level messages will be logged at the same level as warnings.

Additionally, users will be notified when attempting to run the test suite without first placing the site in debug mode.

git-svn-id: http://code.elgg.org/elgg/trunk@3567 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/lib/elgglib.php
engine/tests/suite.php

index a77922a9f184f427c00bfc7fcb33d4e205fa11b0..7a10cd809d8071a40791c5ce676f04154b08e7e9 100644 (file)
@@ -266,10 +266,10 @@ function elgg_view($view, $vars = "", $bypass = false, $debug = false, $viewtype
                                }
                        }
                        if (!$success) {
-                               elgg_log(" [This view ($view) does not exist] ", 'ERROR');
+                               elgg_log("The view $view does not exist", 'ERROR');
                        }
                } else if (!file_exists("$view_location$viewtype/$view.php")) {
-                       elgg_log(" [This view ($view) does not exist] ", 'WARNING');
+                       elgg_log("The view $view does not exist", 'WARNING');
                }
 
        }
@@ -1756,12 +1756,12 @@ function elgg_log($message, $level='NOTICE') {
                $to_screen = !($CONFIG->debug == 'NOTICE');
                
                switch ($level) {
-                       case 'DEBUG':
                        case 'ERROR':
                                // always report
                                elgg_dump("$level: $message", $to_screen);
                                break;
                        case 'WARNING':
+                       case 'DEBUG':
                                // report execept if user wants only errors
                                if ($CONFIG->debug != 'ERROR') {
                                        elgg_dump("$level: $message", $to_screen);
index c3de185ffcf2eb34a720f519cee58b5fdeddc8d3..8bb7d806494ec95a899745aae389392b2c16ad78 100755 (executable)
@@ -29,8 +29,7 @@ foreach ($test_files as $file) {
 
 // Only run tests in debug mode.
 if (!isset($CONFIG->debug)) {
-       // @todo display an error?
-       exit (1);
+       exit ('The site must be in debug mode to run unit tests.');
 }
 
 if (TextReporter::inCli()) {