disable log when running tests

This commit is contained in:
Robin Appelman 2012-10-12 15:45:05 +02:00
parent 6f3e039e78
commit d589869a34
2 changed files with 9 additions and 5 deletions

View File

@ -20,6 +20,7 @@ class OC_Log {
const ERROR=3;
const FATAL=4;
static public $enabled = true;
static protected $class = null;
/**
@ -29,11 +30,13 @@ class OC_Log {
* @param int level
*/
public static function write($app, $message, $level) {
if (!self::$class) {
self::$class = 'OC_Log_'.ucfirst(OC_Config::getValue('log_type', 'owncloud'));
call_user_func(array(self::$class, 'init'));
if (self::$enabled) {
if (!self::$class) {
self::$class = 'OC_Log_'.ucfirst(OC_Config::getValue('log_type', 'owncloud'));
call_user_func(array(self::$class, 'init'));
}
$log_class=self::$class;
$log_class::write($app, $message, $level);
}
$log_class=self::$class;
$log_class::write($app, $message, $level);
}
}

View File

@ -26,3 +26,4 @@ abstract class UnitTestCase extends PHPUnit_Framework_TestCase{
}
OC_Hook::clear();
OC_Log::$enabled = false;