1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-21 16:46:11 +02:00

Implement the 8 RFC3164 severity levels instead of just 6.

- constants defined for the 2 missing levels: NOTICE and EMERGENCY.
- add<level>() and <level>() convenience methods added.
- TestHandler and tests updated to account for the two extra levels.
- surjective mappings from the RFC3164 to only 6 levels changes to bijective.
- README updated accordingly.
This commit is contained in:
Frederic G. MARAND
2012-05-28 20:29:27 +02:00
parent 2eb0c0978d
commit 07aac12c72
6 changed files with 107 additions and 38 deletions

View File

@@ -30,6 +30,11 @@ class TestHandler extends AbstractProcessingHandler
return $this->records;
}
public function hasEmergency($record)
{
return $this->hasRecord($record, Logger::EMERGENCY);
}
public function hasAlert($record)
{
return $this->hasRecord($record, Logger::ALERT);
@@ -50,6 +55,11 @@ class TestHandler extends AbstractProcessingHandler
return $this->hasRecord($record, Logger::WARNING);
}
public function hasNotice($record)
{
return $this->hasRecord($record, Logger::NOTICE);
}
public function hasInfo($record)
{
return $this->hasRecord($record, Logger::INFO);
@@ -60,6 +70,11 @@ class TestHandler extends AbstractProcessingHandler
return $this->hasRecord($record, Logger::DEBUG);
}
public function hasEmergencyRecords()
{
return isset($this->recordsByLevel[Logger::EMERGENCY]);
}
public function hasAlertRecords()
{
return isset($this->recordsByLevel[Logger::ALERT]);
@@ -80,6 +95,11 @@ class TestHandler extends AbstractProcessingHandler
return isset($this->recordsByLevel[Logger::WARNING]);
}
public function hasNoticeRecords()
{
return isset($this->recordsByLevel[Logger::NOTICE]);
}
public function hasInfoRecords()
{
return isset($this->recordsByLevel[Logger::INFO]);