1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-07 21:56:31 +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

@@ -319,10 +319,12 @@ class LoggerTest extends \PHPUnit_Framework_TestCase
* @dataProvider logMethodProvider
* @covers Monolog\Logger::addDebug
* @covers Monolog\Logger::addInfo
* @covers Monolog\Logger::addNotice
* @covers Monolog\Logger::addWarning
* @covers Monolog\Logger::addError
* @covers Monolog\Logger::addCritical
* @covers Monolog\Logger::addAlert
* @covers Monolog\Logger::addEmergency
* @covers Monolog\Logger::debug
* @covers Monolog\Logger::info
* @covers Monolog\Logger::notice
@@ -346,22 +348,24 @@ class LoggerTest extends \PHPUnit_Framework_TestCase
{
return array(
// monolog methods
array('addDebug', Logger::DEBUG),
array('addInfo', Logger::INFO),
array('addWarning', Logger::WARNING),
array('addError', Logger::ERROR),
array('addCritical', Logger::CRITICAL),
array('addAlert', Logger::ALERT),
array('addDebug', Logger::DEBUG),
array('addInfo', Logger::INFO),
array('addNotice', Logger::NOTICE),
array('addWarning', Logger::WARNING),
array('addError', Logger::ERROR),
array('addCritical', Logger::CRITICAL),
array('addAlert', Logger::ALERT),
array('addEmergency', Logger::EMERGENCY),
// ZF/Sf2 compat methods
array('debug', Logger::DEBUG),
array('info', Logger::INFO),
array('notice', Logger::INFO),
array('notice', Logger::NOTICE),
array('warn', Logger::WARNING),
array('err', Logger::ERROR),
array('crit', Logger::CRITICAL),
array('alert', Logger::ALERT),
array('emerg', Logger::ALERT),
array('emerg', Logger::EMERGENCY),
);
}
}