Skip to content

Commit

Permalink
changing LOG_ERROR to LOG_ERR in core files
Browse files Browse the repository at this point in the history
  • Loading branch information
rchavik committed May 13, 2012
1 parent 595cad8 commit e6860fb
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/Cake/Core/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,7 @@ protected static function _checkFatalError() {
}

list(, $log) = ErrorHandler::mapErrorCode($lastError['type']);
if ($log !== LOG_ERROR) {
if ($log !== LOG_ERR) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Core/Object.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ protected function _stop($status = 0) {
* @param integer $type Error type constant. Defined in app/Config/core.php.
* @return boolean Success of log write
*/
public function log($msg, $type = LOG_ERROR) {
public function log($msg, $type = LOG_ERR) {
App::uses('CakeLog', 'Log');
if (!is_string($msg)) {
$msg = print_r($msg, true);
Expand Down
6 changes: 3 additions & 3 deletions lib/Cake/Error/ErrorHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public static function handleError($code, $description, $file = null, $line = nu
}
$errorConfig = Configure::read('Error');
list($error, $log) = self::mapErrorCode($code);
if ($log === LOG_ERROR) {
if ($log === LOG_ERR) {
return self::handleFatalError($code, $description, $file, $line);
}

Expand Down Expand Up @@ -197,7 +197,7 @@ public static function handleError($code, $description, $file = null, $line = nu
*/
public static function handleFatalError($code, $description, $file, $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');
if (!is_callable($exceptionHandler)) {
Expand Down Expand Up @@ -231,7 +231,7 @@ public static function mapErrorCode($code) {
case E_COMPILE_ERROR:
case E_USER_ERROR:
$error = 'Fatal Error';
$log = LOG_ERROR;
$log = LOG_ERR;
break;
case E_WARNING:
case E_USER_WARNING:
Expand Down
4 changes: 2 additions & 2 deletions lib/Cake/Test/Case/Log/Engine/ConsoleLogTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function testConsoleOutputWrites() {
$message = 'Test error message';
$mock->expects($this->once())
->method('write');
TestCakeLog::write(LOG_ERROR, $message);
TestCakeLog::write(LOG_ERR, $message);
}

/**
Expand All @@ -96,7 +96,7 @@ public function testCombinedLogWriting() {
$message = 'Test error message';
$mock->expects($this->once())
->method('write');
TestCakeLog::write(LOG_ERROR, $message);
TestCakeLog::write(LOG_ERR, $message);
$this->assertTrue(file_exists(LOGS . 'error.log'), 'error.log missing');
$logOutput = file_get_contents(LOGS . 'error.log');
$this->assertContains($message, $logOutput);
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Utility/Debugger.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ public static function showError($code, $description, $file = null, $line = null
case E_COMPILE_ERROR:
case E_USER_ERROR:
$error = 'Fatal Error';
$level = LOG_ERROR;
$level = LOG_ERR;
break;
case E_WARNING:
case E_USER_WARNING:
Expand Down

0 comments on commit e6860fb

Please sign in to comment.