Logger::ERROR, OutputInterface::VERBOSITY_NORMAL => Logger::WARNING, OutputInterface::VERBOSITY_VERBOSE => Logger::NOTICE, OutputInterface::VERBOSITY_VERY_VERBOSE => Logger::INFO, OutputInterface::VERBOSITY_DEBUG => Logger::DEBUG, ); * @var OutputInterface */ protected $output; /** * @param OutputInterface $output */ public function __construct(OutputInterface $output) { parent::__construct(static::$levels[$output->getVerbosity()]); $this->output = $output; } /** * Write a log entry to the terminal. * @param array $record */ protected function write(array $record) { if ($record['level'] >= Logger::ERROR && $this->output instanceof ConsoleOutputInterface) { $output = $this->output->getErrorOutput(); } else { $output = $this->output; } $output->write($record['formatted']); } }