for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace DP\Core\CoreBundle\Monolog;
use Monolog\Formatter\FormatterInterface;
use Monolog\Handler\HandlerInterface;
class DebugOnlyHandler implements HandlerInterface
{
/**
* @var HandlerInterface
*/
private $handler;
* @var bool
private $debug;
* @param HandlerInterface $handler
* @param bool $debug
public function __construct(HandlerInterface $handler, $debug)
$this->handler = $handler;
$this->debug = $debug;
}
* {@inheritdoc}
public function isHandling(array $record)
if (false === $this->debug) {
return false;
return $this->handler->isHandling($record);
public function handle(array $record)
return $this->handler->handle($record);
public function handleBatch(array $records)
return;
$this->handler->handleBatch($records);
public function pushProcessor($callback)
$this->handler->pushProcessor($callback);
return $this;
public function popProcessor()
return $this->handler->popProcessor();
public function setFormatter(FormatterInterface $formatter)
$this->handler->setFormatter($formatter);
public function getFormatter()
return $this->handler->getFormatter();