diff --git a/cake/console/libs/console_error_handler.php b/cake/console/libs/console_error_handler.php index fc8414767..0ee83ae43 100644 --- a/cake/console/libs/console_error_handler.php +++ b/cake/console/libs/console_error_handler.php @@ -76,9 +76,13 @@ class ConsoleErrorHandler extends ErrorHandler { } $stderr = self::getStderr(); list($name, $log) = self::_mapErrorCode($code); - $stderr->write(sprintf( - __("%s Error: %s in [%s, line %s]\n"), $name, $description, $file, $line - )); + $message = sprintf(__('%s in [%s, line %s]'), $description, $file, $line); + $stderr->write(sprintf(__("%s Error: %s\n"), $name, $message)); + + if (Configure::read('debug') == 0) { + App::import('Core', 'CakeLog'); + CakeLog::write($log, $message); + } } /**