Adding logging of errors when debug = 0 for console applications. Fixes #1311

This commit is contained in:
mark_story 2010-11-25 23:16:27 -05:00
parent 0d5ed014d1
commit c717ff2e72

View file

@ -76,9 +76,13 @@ class ConsoleErrorHandler extends ErrorHandler {
}
$stderr = self::getStderr();
list($name, $log) = self::_mapErrorCode($code);
$stderr->write(sprintf(
__("<error>%s Error:</error> %s in [%s, line %s]\n"), $name, $description, $file, $line
));
$message = sprintf(__('%s in [%s, line %s]'), $description, $file, $line);
$stderr->write(sprintf(__("<error>%s Error:</error> %s\n"), $name, $message));
if (Configure::read('debug') == 0) {
App::import('Core', 'CakeLog');
CakeLog::write($log, $message);
}
}
/**