Seldaek/monolog — pull request #338 by hver (2014-03-17 14:27:58+00:00)
Title: Added MinMaxHandler.

I have created a small wrapper handler, which allow to define which log level messages should be passed to wrapped handler.

In particular, we are logging all levels to *someNormalHandler* and have **fingerCrossedHandler**(with *someDebugHandler*) which activates on error and should additionally log `DEBUG` level. In the case, that there comes an error, all the messages from `DEBUG` to `EMERGENCY` got duplicated, because they got processed by both handlers. Now, **fingerCrossedHandler** uses **MinMaxHandler**(with *debugHandler*) and everything is logged as expected (`DEBUG`->*someDebugHandler*, `INFO`-`EMERGENCY`->*someNormalHandler*).

Example from unit tests:
(Only records with log level between INFO and NOTICE are logged, other are ignored.)
```php
$test = new TestHandler();
$handler = new MinMaxHandler($test, Logger::INFO, Logger::NOTICE);

$handler->handle($this->getRecord(Logger::DEBUG));
$this->assertFalse($test->hasDebugRecords());

$handler->handle($this->getRecord(Logger::INFO));
$this->assertTrue($test->hasInfoRecords());

$handler->handle($this->getRecord(Logger::WARNING));
$this->assertFalse($test->hasWarningRecords());
```