Add support for Monolog 1.2.0

This commit is contained in:
Jordi Boggiano 2012-08-18 19:41:54 +02:00
parent ee572b34cf
commit 832f8dd4fe
1 changed files with 5 additions and 1 deletions

View File

@ -47,7 +47,11 @@ class DebugHandler extends TestHandler implements DebugLoggerInterface
public function countErrors()
{
$cnt = 0;
foreach (array(Logger::ERROR, Logger::CRITICAL, Logger::ALERT) as $level) {
$levels = array(Logger::ERROR, Logger::CRITICAL, Logger::ALERT);
if (defined('Monolog\Logger::EMERGENCY')) {
$levels[] = Logger::EMERGENCY;
}
foreach ($levels as $level) {
if (isset($this->recordsByLevel[$level])) {
$cnt += count($this->recordsByLevel[$level]);
}