php-censor/PHPCI/Logging/OutputLogHandler.php

37 lines
840 B
PHP
Raw Normal View History

<?php
/**
* PHPCI - Continuous Integration for PHP
*
* @copyright Copyright 2014, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/
*/
namespace PHPCI\Logging;
use Monolog\Handler\AbstractProcessingHandler;
use Psr\Log\LogLevel;
use Symfony\Component\Console\Output\OutputInterface;
class OutputLogHandler extends AbstractProcessingHandler
{
2013-10-26 17:25:34 +02:00
/**
* @var OutputInterface
*/
protected $output;
2014-02-27 15:23:51 +01:00
public function __construct(
2013-10-26 17:25:34 +02:00
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']);
}
2014-02-27 15:23:51 +01:00
}