1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-02-24 06:52:34 +01:00

removed the logic for the fallback handler, its out of place, adapted the "test"

This commit is contained in:
odino 2013-06-29 02:05:03 +04:00
parent 33ea09eb6a
commit 394b0bf872
2 changed files with 2 additions and 18 deletions

View File

@ -17,9 +17,7 @@ namespace Monolog\Handler;
* @see https://newrelic.com/docs/php/new-relic-for-php
*/
class NewRelicHandler extends AbstractProcessingHandler
{
protected $fallbackHandler;
{
/**
* {@inheritdoc}
*/
@ -31,19 +29,6 @@ class NewRelicHandler extends AbstractProcessingHandler
foreach ($record['context'] as $key => $parameter) {
newrelic_add_custom_parameter($key, $parameter);
}
} elseif ($this->fallbackHandler instanceOf AbstractProcessingHandler) {
$this->fallbackHandler->write($record);
}
}
/**
* Sets the fallback handler to be used to log informations if the New Relic
* extension is not available.
*
* @param Monolog\Handler\AbstractProcessingHandler $handler
*/
public function setFallbackHandler(AbstractProcessingHandler $handler)
{
$this->fallbackHandler = $handler;
}
}

View File

@ -20,7 +20,6 @@ class NewRelicHandlerTest extends TestCase
{
$handler = new NewRelicHandler();
$fallbackHandler = new TestHandler();
$handler->setFallbackHandler($fallbackHandler);
$record = array(
'level' => Logger::DEBUG,
'extra' => array(),
@ -28,6 +27,6 @@ class NewRelicHandlerTest extends TestCase
$handler->handle($record);
$this->assertCount(1, $fallbackHandler->getRecords());
$this->assertTrue($handler->isHandling($record));
}
}