1: <?php
2: namespace Contrib\Component\Log;
3:
4: use Psr\Log\AbstractLogger;
5: use Symfony\Component\Console\Output\OutputInterface;
6:
7: /**
8: * Console logger for php-coveralls command.
9: *
10: * @author Kitamura Satoshi <with.no.parachute@gmail.com>
11: */
12: class ConsoleLogger extends AbstractLogger
13: {
14: /**
15: * Output.
16: *
17: * @var \Symfony\Component\Console\Output\OutputInterface
18: */
19: protected $output;
20:
21: /**
22: * Constructor.
23: *
24: * @param OutputInterface $output
25: */
26: public function __construct(OutputInterface $output)
27: {
28: $this->output = $output;
29: }
30:
31: /**
32: * {@inheritdoc}
33: *
34: * @return void
35: * @see \Psr\Log\LoggerInterface::log()
36: */
37: public function log($level, $message, array $context = array())
38: {
39: $this->output->writeln($message);
40: }
41: }
42: