|
12 | 12 | namespace Symfony\Bundle\WebServerBundle\Command;
|
13 | 13 |
|
14 | 14 | use Monolog\Formatter\FormatterInterface;
|
| 15 | +use Monolog\Logger; |
15 | 16 | use Symfony\Bridge\Monolog\Formatter\ConsoleFormatter;
|
16 | 17 | use Symfony\Bridge\Monolog\Handler\ConsoleHandler;
|
17 | 18 | use Symfony\Component\Console\Command\Command;
|
@@ -85,7 +86,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
|
85 | 86 | $this->el = new ExpressionLanguage();
|
86 | 87 | }
|
87 | 88 |
|
88 |
| - $this->handler = new ConsoleHandler($output); |
| 89 | + $this->handler = new ConsoleHandler($output, true, [ |
| 90 | + OutputInterface::VERBOSITY_NORMAL => Logger::DEBUG, |
| 91 | + ]); |
89 | 92 |
|
90 | 93 | $this->handler->setFormatter(new ConsoleFormatter([
|
91 | 94 | 'format' => str_replace('\n', "\n", $input->getOption('format')),
|
@@ -143,13 +146,11 @@ private function getLogs($socket)
|
143 | 146 |
|
144 | 147 | private function displayLog(InputInterface $input, OutputInterface $output, $clientId, array $record)
|
145 | 148 | {
|
146 |
| - if ($this->handler->isHandling($record)) { |
147 |
| - if (isset($record['log_id'])) { |
148 |
| - $clientId = unpack('H*', $record['log_id'])[1]; |
149 |
| - } |
150 |
| - $logBlock = sprintf('<bg=%s> </>', self::$bgColor[$clientId % 8]); |
151 |
| - $output->write($logBlock); |
| 149 | + if (isset($record['log_id'])) { |
| 150 | + $clientId = unpack('H*', $record['log_id'])[1]; |
152 | 151 | }
|
| 152 | + $logBlock = sprintf('<bg=%s> </>', self::$bgColor[$clientId % 8]); |
| 153 | + $output->write($logBlock); |
153 | 154 |
|
154 | 155 | $this->handler->handle($record);
|
155 | 156 | }
|
|
0 commit comments