Beispiel #1
0
 /**
  * @return Logger|LoggerInterface
  */
 protected function getLogger()
 {
     if (null === $this->logger) {
         $handler = null;
         if ($this->output->isQuiet()) {
             $handler = new NullHandler();
         } else {
             $handler = new StreamHandler($this->output->getStream(), $this->getLogLevel());
             if (!$this->input->getOption('no-ansi')) {
                 $handler->setFormatter(new ConsoleColorFormatter());
             }
         }
         $logger = new Logger('core');
         $logger->pushHandler($handler);
         $this->logger = $logger;
     }
     return $this->logger;
 }