changing LOG_ERROR to LOG_ERR in core files

This commit is contained in:
Rachman Chavik 2012-05-11 20:42:54 +07:00
parent 595cad84b3
commit e6860fb856
5 changed files with 8 additions and 8 deletions

View file

@ -909,7 +909,7 @@ class App {
} }
list(, $log) = ErrorHandler::mapErrorCode($lastError['type']); list(, $log) = ErrorHandler::mapErrorCode($lastError['type']);
if ($log !== LOG_ERROR) { if ($log !== LOG_ERR) {
return; return;
} }

View file

@ -146,7 +146,7 @@ class Object {
* @param integer $type Error type constant. Defined in app/Config/core.php. * @param integer $type Error type constant. Defined in app/Config/core.php.
* @return boolean Success of log write * @return boolean Success of log write
*/ */
public function log($msg, $type = LOG_ERROR) { public function log($msg, $type = LOG_ERR) {
App::uses('CakeLog', 'Log'); App::uses('CakeLog', 'Log');
if (!is_string($msg)) { if (!is_string($msg)) {
$msg = print_r($msg, true); $msg = print_r($msg, true);

View file

@ -158,7 +158,7 @@ class ErrorHandler {
} }
$errorConfig = Configure::read('Error'); $errorConfig = Configure::read('Error');
list($error, $log) = self::mapErrorCode($code); list($error, $log) = self::mapErrorCode($code);
if ($log === LOG_ERROR) { if ($log === LOG_ERR) {
return self::handleFatalError($code, $description, $file, $line); return self::handleFatalError($code, $description, $file, $line);
} }
@ -197,7 +197,7 @@ class ErrorHandler {
*/ */
public static function handleFatalError($code, $description, $file, $line) { public static function handleFatalError($code, $description, $file, $line) {
$logMessage = 'Fatal Error (' . $code . '): ' . $description . ' in [' . $file . ', line ' . $line . ']'; $logMessage = 'Fatal Error (' . $code . '): ' . $description . ' in [' . $file . ', line ' . $line . ']';
CakeLog::write(LOG_ERROR, $logMessage); CakeLog::write(LOG_ERR, $logMessage);
$exceptionHandler = Configure::read('Exception.handler'); $exceptionHandler = Configure::read('Exception.handler');
if (!is_callable($exceptionHandler)) { if (!is_callable($exceptionHandler)) {
@ -231,7 +231,7 @@ class ErrorHandler {
case E_COMPILE_ERROR: case E_COMPILE_ERROR:
case E_USER_ERROR: case E_USER_ERROR:
$error = 'Fatal Error'; $error = 'Fatal Error';
$log = LOG_ERROR; $log = LOG_ERR;
break; break;
case E_WARNING: case E_WARNING:
case E_USER_WARNING: case E_USER_WARNING:

View file

@ -77,7 +77,7 @@ class ConsoleLogTest extends CakeTestCase {
$message = 'Test error message'; $message = 'Test error message';
$mock->expects($this->once()) $mock->expects($this->once())
->method('write'); ->method('write');
TestCakeLog::write(LOG_ERROR, $message); TestCakeLog::write(LOG_ERR, $message);
} }
/** /**
@ -96,7 +96,7 @@ class ConsoleLogTest extends CakeTestCase {
$message = 'Test error message'; $message = 'Test error message';
$mock->expects($this->once()) $mock->expects($this->once())
->method('write'); ->method('write');
TestCakeLog::write(LOG_ERROR, $message); TestCakeLog::write(LOG_ERR, $message);
$this->assertTrue(file_exists(LOGS . 'error.log'), 'error.log missing'); $this->assertTrue(file_exists(LOGS . 'error.log'), 'error.log missing');
$logOutput = file_get_contents(LOGS . 'error.log'); $logOutput = file_get_contents(LOGS . 'error.log');
$this->assertContains($message, $logOutput); $this->assertContains($message, $logOutput);

View file

@ -227,7 +227,7 @@ class Debugger {
case E_COMPILE_ERROR: case E_COMPILE_ERROR:
case E_USER_ERROR: case E_USER_ERROR:
$error = 'Fatal Error'; $error = 'Fatal Error';
$level = LOG_ERROR; $level = LOG_ERR;
break; break;
case E_WARNING: case E_WARNING:
case E_USER_WARNING: case E_USER_WARNING: