mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Adding logging of errors when debug = 0 for console applications. Fixes #1311
This commit is contained in:
parent
0d5ed014d1
commit
c717ff2e72
1 changed files with 7 additions and 3 deletions
|
@ -76,9 +76,13 @@ class ConsoleErrorHandler extends ErrorHandler {
|
||||||
}
|
}
|
||||||
$stderr = self::getStderr();
|
$stderr = self::getStderr();
|
||||||
list($name, $log) = self::_mapErrorCode($code);
|
list($name, $log) = self::_mapErrorCode($code);
|
||||||
$stderr->write(sprintf(
|
$message = sprintf(__('%s in [%s, line %s]'), $description, $file, $line);
|
||||||
__("<error>%s Error:</error> %s in [%s, line %s]\n"), $name, $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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue