32 lines
557 B
PHP
32 lines
557 B
PHP
|
<?php
|
||
|
|
||
|
namespace PHPCI\Helper;
|
||
|
|
||
|
use Monolog\Handler\AbstractProcessingHandler;
|
||
|
use Psr\Log\LogLevel;
|
||
|
use Symfony\Component\Console\Output\OutputInterface;
|
||
|
|
||
|
class OutputLogHandler extends AbstractProcessingHandler
|
||
|
{
|
||
|
|
||
|
/**
|
||
|
* @var OutputInterface
|
||
|
*/
|
||
|
protected $output;
|
||
|
|
||
|
function __construct(OutputInterface $output,
|
||
|
$level = LogLevel::INFO,
|
||
|
$bubble = true)
|
||
|
{
|
||
|
parent::__construct($level, $bubble);
|
||
|
$this->output = $output;
|
||
|
}
|
||
|
|
||
|
|
||
|
protected function write(array $record)
|
||
|
{
|
||
|
$this->output->writeln((string) $record['formatted']);
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|