mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-04 12:17:35 +02:00
Added support of ALERT and CRITICAL in TestHandler
This commit is contained in:
@@ -30,6 +30,16 @@ class TestHandler extends AbstractHandler
|
||||
return $this->records;
|
||||
}
|
||||
|
||||
public function hasAlert($record)
|
||||
{
|
||||
return $this->hasRecord($record, Logger::ALERT);
|
||||
}
|
||||
|
||||
public function hasCritical($record)
|
||||
{
|
||||
return $this->hasRecord($record, Logger::CRITICAL);
|
||||
}
|
||||
|
||||
public function hasError($record)
|
||||
{
|
||||
return $this->hasRecord($record, Logger::ERROR);
|
||||
@@ -50,6 +60,16 @@ class TestHandler extends AbstractHandler
|
||||
return $this->hasRecord($record, Logger::DEBUG);
|
||||
}
|
||||
|
||||
public function hasAlertRecords()
|
||||
{
|
||||
return isset($this->recordsByLevel[Logger::ALERT]);
|
||||
}
|
||||
|
||||
public function hasCriticalRecords()
|
||||
{
|
||||
return isset($this->recordsByLevel[Logger::CRITICAL]);
|
||||
}
|
||||
|
||||
public function hasErrorRecords()
|
||||
{
|
||||
return isset($this->recordsByLevel[Logger::ERROR]);
|
||||
|
Reference in New Issue
Block a user