Print information about a rokka stack.

@param Stack           $stack
@param OutputInterface $output
777082
public function outputStackInfo(Stack $stack, OutputInterface $output)
    {
        $output->writeln('  Name: <info>'.$stack->getName().'</info>');
        $output->writeln('  Created: <info>'.$stack->getCreated()->format('Y-m-d H:i:s').'</info>');

        $operations = $stack->getStackOperations();
        if (!empty($operations)) {
            $output->writeln('  Operations:');

            foreach ($stack->getStackOperations() as $operation) {
                $output->write('    '.$operation->name.': ');
                $output->writeln($this->formatStackOperationOptions($operation->options));
            }
        }

        $options = $stack->getStackOptions();
        if (!empty($options)) {
            $output->writeln('  Options:');
            foreach ($stack->getStackOptions() as $name => $value) {
                $output->write('    '.$name.': ');
                $output->writeln('<info>'.$value.'</info>');
            }
        }
    }
1121185
public function printSuccessMessage($joinString, $force = true): void
    {
        if ($this->isPrintable($force)) {
            $this->printMessage(implode(': ', ['Success', $joinString]), 'info');
        }
    }
740715
protected function _outputHandle($output=null)
    {
        if ($output === null) {
            // do nothing
        } elseif ($output instanceof ResponseInterface) {
            $this->response = $output;
        } elseif ($output) {
            if (is_scalar($output)) {
                $this->response = $this->renderText($output);
            } elseif (is_array($output)) {
                $this->response = $this->renderJson($output);
            } elseif ($output instanceof Collection) {
                $this->response = $this->renderJson($output->all());
            }
        }
        
        if ($data = $this->getRenderBuffer()) {
            $this->response->write($data);
        }
        
        return $this->response;
    }
1027828
protected function output()
    {
        if ($this->bottomIcon === null) {
            $this->bottomIcon = '';
            //throw new IncompleteStackException();
        }

        $stackClasses = 'fa-stack';

        if (count($this->classes) > 0) {
            $stackClasses .= ' ' . implode(' ', $this->classes);
        }

        return sprintf(self::STACK_HTML, $stackClasses, $this->topIcon, $this->bottomIcon);
    }
1017625
protected function printMessage(OutputInterface $output, array $response)
    {
        $this->printBoolean($output, $response['message'], $response['message'], true === $response['success']);
    }
234628
public static void printStackTrace(StackTraceElement[] trace, java.io.PrintStream out) {
        Strand.printStackTrace(trace, out);
    }
943860
private function reportChange(OutputInterface $output)
    {
        $this->end = microtime(true);

        $output->writeLn(
            sprintf('[DROID-RESULT] %s', json_encode(array(
                'changed' => $this->change,
                'start' => $this->start,
                'end' => $this->end,
            )))
        );
    }
853437
private function countStackMessages(Stack $stack)
    {
        return 1 + array_sum(array_map(function (Stack $child) {
            return $this->countStackMessages($child);
        }, $this->getChildrenStacks($stack)));
    }
806200
protected function listReporters(OutputInterface $output)
    {
        $output->writeln("");
        foreach ($this->factory->getReporters() as $name => $info) {
            $output->writeln(sprintf("    %s - %s", $name, $info['description']));
        }
        $output->writeln("");
    }
1271064
protected function formatOutput(OutputInterface $output, ConvertedResultIterator $fields_infos)
    {
        $output->writeln(sprintf("Relation <fg=cyan>%s.%s</fg=cyan>", $this->schema, $this->relation));
        $table = (new Table($output))
            ->setHeaders(['pk', 'name', 'type', 'default', 'notnull', 'comment'])
            ;

        foreach ($fields_infos as $info) {
            $table->addRow(
                [
                    $info['is_primary'] ? '<fg=cyan>*</fg=cyan>' : '',
                    sprintf("<fg=yellow>%s</fg=yellow>", $info['name']),
                    $this->formatType($info['type']),
                    $info['default'],
                    $info['is_notnull'] ? 'yes' : 'no',
                    wordwrap($info['comment']),
                ]
            );
        }

        $table->render();
    }
25546
public function printout($clear = true, $runlevel = null) {
		if($runlevel === null) {
			$runlevel = $this->runlevel;
		}
		foreach($this->data as $data) {
			if($runlevel <= $data[0]) {
				$this->writeLine($data[1], $runlevel, $data[2]);
			}
		}
		if($clear) {
			$this->data = array();
		}
	}
460771
def handle_output(self, workunit, label, stream):
    """"""

    self._root_id_to_workunit_stack[str(workunit.root().id)][-1]['outputs'][label] += stream
265350
private function getStackTraceToString($stack) {
        $max = 0;
        $trace = '';

        for ($i = 3; $i < count($stack) && $max < 4; $i++) {
            if (isset($stack[$i]['file']) && preg_match('#(' . preg_quote('System\Orm') . ')#isU', $stack[$i]['file'])) { //ORM
                $trace .= str_replace('\\', '-', $stack[$i]['class']) . '_' . $stack[$i]['function'] . '_' . $stack[$i - 1]['line'] . '__';
            }
        }

        return $trace;
    }
1109638
private function printText(OutputPrinter $printer, $stepType, $stepText, StepResult $result)
    {
        if ($result && $result instanceof DefinedStepResult && $result->getStepDefinition()) {
            $definition = $result->getStepDefinition();
            $stepText = $this->textPainter->paintText($stepText, $definition, $result);
        }

        $style = $this->resultConverter->convertResultToString($result);
        $printer->write(sprintf('%s{+%s}%s %s{-%s}', $this->indentText, $style, $stepType, $stepText, $style));
    }
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);
    }
67445
private function output(OutputInterface $output, array $response)
    {
        $this->printList($output,
            ['Name', 'Key', 'Type', 'Public', 'Outdated', 'Updated At', 'Bad Licenses', 'Unknown Licenses'],
            ['name', 'id', 'project_type', 'public', 'out_number', 'updated_at', 'licenses_red', 'licenses_unknown'],
            $response,
            function ($key, $value) use ($output) {
                if (in_array($key, ['Outdated', 'Bad Licenses', 'Unknown Licenses'], true)) {
                    return $this->printBoolean($output, $value === 0 ? 'No' : $value, $value, !$value, false);
                }

                return $value;
            }
        );

        $this->printTable($output,
            ['Name', 'Stable', 'Outdated', 'Current', 'Requested', 'Licenses', 'Vulnerabilities'],
            ['name', 'stable', 'outdated', 'version_current', 'version_requested', 'licenses', 'security_vulnerabilities'],
            $response['dependencies'],
            function ($key, $value) use ($output) {
                if ('licenses' === $key) {
                    return implode(', ', array_column($value, 'name'));
                }
                if ('stable' === $key) {
                    return $this->printBoolean($output, 'Yes', 'No', $value, false);
                }
                if ('outdated' === $key) {
                    return $this->printBoolean($output, 'No', 'Yes', !$value, false);
                }

                if ('security_vulnerabilities' === $key) {
                    if (is_array($value)) {
                        return $this->printBoolean($output, 'No', implode(', ', array_column($value, 'cve')), count($value) === 0, false);
                    }

                    return $this->printBoolean($output, 'No', 'Yes', true, false);
                }

                return $value;
            }
        );
    }
1284075
public static function printTokens(
        InputInterface $input,
        OutputInterface $output,
        array $tokens
    ) {
        $withMetadata = $input->getOption('with-metadata');
        $table = new Table($output);
        $headers = ['UUID', 'Indices', 'endpoints', 'plugins', 'ttl'];
        if ($withMetadata) {
            $headers[] = 'Metadata';
        }
        $table->setHeaders($headers);

        foreach ($tokens as $token) {
            $row = [
                $token->getTokenUUID()->composeUUID(),
                implode(', ', array_map(function (IndexUUID $index) {
                    return $index->composeUUID();
                }, $token->getIndices())),
                implode(', ', $token->getEndpoints()),
                implode(', ', $token->getPlugins()),
                $token->getTtl(),
            ];

            if ($withMetadata) {
                $metadataRow = [];
                foreach ($token->getMetadata() as $metadataField => $metadataValue) {
                    $metadataRow[] = sprintf("$metadataField = %s",
                        is_bool($metadataValue)
                            ? $metadataValue ? 'true' : 'false'
                            : (
                                is_array($metadataValue)
                                    ? implode(', ', $metadataValue)
                                    : (string) $metadataValue
                            )
                    );
                }
                $row[] = implode(PHP_EOL, $metadataRow);
            }

            $table->addRow($row);
        }

        $table->render();
    }