Skip to content

Commit

Permalink
Adding logging of errors when debug = 0 for console applications. Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Nov 26, 2010
1 parent 0d5ed01 commit c717ff2
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions cake/console/libs/console_error_handler.php
Expand Up @@ -76,9 +76,13 @@ public static function handleError($code, $description, $file = null, $line = nu
}
$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);
}
}

/**
Expand Down

0 comments on commit c717ff2

Please sign in to comment.