Creates a PSR logger instance which prints messages to the command output

@param OutputInterface $output
@return ConsoleLogger
436566
protected function makeConsoleLogger(OutputInterface $output): ConsoleLogger
    {
        return new ConsoleLogger($output, [
            LogLevel::DEBUG  => OutputInterface::VERBOSITY_VERY_VERBOSE,
            LogLevel::INFO   => OutputInterface::VERBOSITY_VERBOSE,
            LogLevel::NOTICE => OutputInterface::VERBOSITY_NORMAL
        ], [
            LogLevel::DEBUG  => '',
            LogLevel::INFO   => '',
            LogLevel::NOTICE => 'info'
        ]);
    }
441539
protected function finishCommand(OutputInterface $output)
    {
        $event = $this->stopStopWatch('command');
        $this
            ->printMessage(
                $output,
                $this->getProjectHeader(),
                'Command finished in ' . $event->getDuration() . ' milliseconds'
            );
        $this->printMessage(
                $output,
                $this->getProjectHeader(),
                'Max memory used: ' . $event->getMemory() . ' bytes'
            );
        $output->writeln('');
    }
220411
private function startProcess(OutputInterface $output)
    {
        $arguments = $this->resolveProcessArgs();
        $name = sha1(serialize($arguments));
        if ($this->background->hasProcess($name)) {
            throw new \RuntimeException("Service is already running.");
        }

        $builder = new ProcessBuilder($arguments);

        if ($this->hasParameter('cwd')) {
            $builder->setWorkingDirectory($this->getParameter('cwd'));
        }

        $process = $builder->getProcess();

        if ($output->getVerbosity() === OutputInterface::VERBOSITY_VERBOSE) {
            $output->writeln($process->getCommandLine());
        }

        if ($this->hasParameter('output')) {
            $append = $this->hasParameter('append') && $this->getParameter('append') ? 'a' : 'w';
            $stream = fopen($this->getParameter('output'), $append);
            $output = new StreamOutput($stream, StreamOutput::VERBOSITY_NORMAL, true);
        }

        $process->start(
            function ($type, $buffer) use ($output) {
                $output->write($buffer);
            }
        );

        $this->background->addProcess($name, $process);

        if (!in_array($process->getExitCode(), $this->getParameter('successCodes'))) {
            throw new TaskRuntimeException($this->getName(), $process->getErrorOutput());
        }
    }
446079
public function getPsrLog(): ?LoggerInterface
    {
        if (!$this->hasPsrLog()) {
            $this->setPsrLog($this->getDefaultPsrLog());
        }
        return $this->psrLog;
    }
869287
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->startCommand($output);
        $plugins = $this
            ->pluginRepository
            ->findAll();

        /**
         * @var Plugin $plugin
         */
        foreach ($plugins as $plugin) {
            $this->printMessage(
                $output,
                'Plugin',
                $plugin->getNamespace() . ' - [Hash : ' . $plugin->getHash() . ']'
            );
        }

        $this->finishCommand($output);
    }
495302
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $logger = $this->getLogger();

        if (!$this->lock()) {
            $output->writeln('<comment>The command is already running in another process.</comment>');
            $logger->warning('Command is already running.');
        } else {
            try {
                $logger->info('Started export in command.');

                $orderVisitor = $this->getOrders();

                $this->getExporter()->exportOrders($orderVisitor, $this->getProgressBar($output, count($orderVisitor)));

                $logger->info('Finished export in command.');
            } catch (Exception $exc) {
                $logger->error('Stopped export in command.', ['exception' => $exc]);
            }
        }
    }
647439
protected function createCompiler(OutputInterface $output)
    {
        $logger   = $this->createConsoleLogger($output);
        $compiler = new Compiler($logger);

        return $compiler;
    }
1040150
public function cli(InputInterface $input = null, OutputInterface $output = null)
  {
    $input = $input ?? new ArgvInput();
    $output = $output ?? new ConsoleOutput();

    $console = $this->getConsole();
    $this->_eventChannel->trigger(ConsolePrepareEvent::i($this->getContext(), $console, $input, $output));

    try
    {
      $exitCode = $console->run($input, $output);
    }
    catch(\Throwable $e)
    {
      $output->writeln("GENERIC EXCEPTION : " . $e->getCode());
      $output->writeln($e->getMessage());
      $exitCode = 1;
    }

    return $exitCode > 255 ? 255 : $exitCode;
  }
515278
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $errOutput = $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output;
        $output->setVerbosity(OutputInterface::VERBOSITY_QUIET);
        $errOutput->setVerbosity(OutputInterface::VERBOSITY_NORMAL);

        $interval = NumberUtils::bound($input->getOption('interval'), 1, 60);
        $context = json_decode($input->getOption('context') ?: '{}', true);
        $context['tenant_id'] = (string)$input->getOption('tenant-id');
        $streamId = StreamId::fromString($input->getArgument('stream-id'));

        $eventStore = $this->getPbjx()->getEventStore();
        $since = Microtime::create();

        while (true) {
            $event = null;
            $slice = $eventStore->getStreamSlice($streamId, $since, 25, true, false, $context);

            foreach ($slice as $event) {
                try {
                    echo json_encode($event) . PHP_EOL;
                } catch (\Throwable $e) {
                    $errOutput->writeln($e->getMessage());
                }
            }

            if ($event instanceof Event) {
                $since = $event->get('occurred_at');
            }

            sleep($interval);
        }
    }
321991
protected function setOutput(OutputInterface $output)
    {
        switch (Config::get('lumos.terminal')) {
            case 'bash':
                $op = new bashOutput($output);
                break;
            case 'cmd':
                $op = new cmdOutput($output);
                break;
            default:
                $op = new bashOutput($output);
                break;
        }
        //
        $this->console = $op;
        $this->output = $op->output;
    }
1060475
public function createController(InputInterface $input, OutputInterface $output)
    {
        $controller = $this->getApplication()->find('create:controller');
        $controller_arguments = array(
            'command'   => 'create:model',
            'module'    => $input->getArgument('module'),
            'table'     => $input->getArgument('table'),
            'column'    => $input->getArgument('column')
        );
        $input_controller   = new ArrayInput($controller_arguments);
        $return_controller  = $controller->run($input_controller,$output);
        return $output->writeln($return_controller);
    }
312336
protected function outputConfiguredHandlers(OutputInterface $output)
    {
        $output->writeln(
            'Configured meta data handlers: ' . implode(', ', array_keys($this->configuredMetadataHandlers))
        );
        $output->writeln(
            'Configured binary data handlers: ' . implode(', ', array_keys($this->configuredBinarydataHandlers))
        );
    }
332617
protected function updateOutput(OutputInterface $output, array $lines = [])
    {
        foreach ($lines as $line) {
            $status = $line["status"] == "ok" ? "<fg=green>✓</fg=green>" : "<fg=red>✗</fg=red>";

            switch ($line['operation']) {
            case "creating":
                $operation = sprintf("<fg=green>%s</fg=green>", ucwords($line['operation']));
                break;
            case "overwriting":
                $operation = sprintf("<fg=cyan>%s</fg=cyan>", ucwords($line['operation']));
                break;
            case "deleting":
                $operation = sprintf("<fg=red>%s</fg=red>", ucwords($line['operation']));
                break;
            default:
                $operation = ucwords($line['operation']);
            }

            $output->writeln(
                sprintf(
                    " %s  %s file <fg=yellow>'%s'</fg=yellow>.",
                    $status,
                    $operation,
                    $line['file']
                )
            );
        }

        return $this;
    }
685298
protected function process(OutputInterface $output, $class)
    {
        $reflection = new \ReflectionClass($class);
        if ($reflection->isAbstract()) {
            $output->writeln(sprintf(
                '<language>%s</language> is abstract, skipping...',
                $reflection->name
            ), OutputInterface::VERBOSITY_VERBOSE);
            return false;
        }

        if (!$reflection->isSubclassOf(Language::class)) {
            $output->writeln(sprintf(
                '<language>%s</language> is not Language, skipping...',
                $reflection->name
            ), OutputInterface::VERBOSITY_VERBOSE);
            return false;
        }

        if ($reflection->getMethod('getMetadata')->getDeclaringClass()->name !== $reflection->name) {
            $output->writeln(sprintf(
                '<language>%s</language>::<info>getAliases</info> is not declared, skipping...',
                $reflection->name
            ), OutputInterface::VERBOSITY_VERBOSE);
            return false;
        }

        $result = array_merge(
            [$reflection->name], // Class name
            array_replace(Language::getMetadata(), call_user_func([$reflection->name, 'getMetadata'])) // metadata with default values
        );
        $output->writeln(var_export($result, true), OutputInterface::VERBOSITY_VERBOSE);

        return $result;
    }
141113
public function setOutput(\Symfony\Component\Console\Output\OutputInterface $output)
    {
        $this->output = $output;
    }
227191
private function generateOutput(InputInterface $input): OutputInterface
    {
        return new Output(
            $this->name,
            array_merge(
                $this->evaluateInputExports($input),
                $this->generateOutputParams($input)
            )
        );
    }
65352
public function output( $output ) {
		$response = $this->response();
		$response = $response->withBody( Psr7\stream_for( $output ) );
		return $response;
	}