Output message

@param string $message - message to output
@param mixed  $colour  - colour name
@param string $output  - where to send output, default is STDOUT
@static
180244
public static function out($message, $colour = false, $output = 'STDOUT')
    {
        if (array_key_exists($output, self::$outputs)) {
            $output = self::$outputs[$output];
        }

        if ($colour) {
            file_put_contents($output, Colours::string($message, $colour).self::$eol, FILE_APPEND);
        } else {
            file_put_contents($output, $message.self::$eol, FILE_APPEND);
        }
    }
996176
public static function output($message, $data = [], $code = 0)
    {
        header('Content-Type:text/html;Charset=' . APP_CHARSET);
        $output = [
            'code' => $code,
            'message' => $message,
            'data' => $data,
        ];
        if (isset($_GET['e_callback']) && $_GET['e_callback']) {
            echo $_GET['e_callback'] . '(' . json_encode($output) . ')';
        } else {
            if (!headers_sent()) header('Content-type: application/json');
            echo json_encode($output);
        }
    }
913652
private function writeOutput($message)
    {
        $lines = explode("\n", $message);

        if ($this->overwrite) {
            // clear the screen
            $this->clear();
        } else {
            // move to new line
            $this->output->writeln('');
        }

        // append whitespace to center the board
        foreach ($lines as $i => $line) {
            $this->output->writeln(str_pad($line, $this->spacesBeforeStart + strlen($line), "\x20", STR_PAD_LEFT));
        }
    }
355294
public function sendOutput(String $output, String $colour='white', String $backgroundColor='black')
	{
		fwrite(STDOUT, $this->getText($output, $colour, $backgroundColor));
	}
94481
protected function writeValidity($output, $message, $isValid = null) {
        if ($this->firstValidityWrite) {
            $output->writeln('');
            $this->firstValidityWrite = false;
        }

        if (is_bool($isValid)) {
            $message = sprintf(
                '%s - %s',
                $isValid ? '<fg=green>Valid</>' : '<fg=red>Invalid</>',
                $message
            );
        }

        $output->writeln($message);
    }
223427
public function executeCommand(array $args, OutputInterface $output, $message)
    {
        $name = $args[0];
        $cmd = $this->getCmd($args);

        $output->writeln('');
        $output->writeln(
            sprintf(
                '<info>Running %s</info>',
                $name
            )
        );

        $output->writeln(
            sprintf(
                '<comment>%s</comment>',
                $cmd
            )
        );

        $this->process->setCommandLine($cmd);
        $this->process->run(
            function ($type, $buffer) use ($output, $cmd) {
                if (Process::ERR === $type) {
                    $output->writeln(
                        sprintf(
                            '<error>%s</error>',
                            $buffer
                        )
                    );
                } else {
                    $output->writeln(
                        sprintf(
                            '<comment>%s</comment>',
                            $buffer
                        )
                    );
                }
            }
        );

        if (!$this->process->isSuccessful()) {
            throw new \RuntimeException($message . '<error>' . $this->process->getErrorOutput() . '</error>');
        }
    }
896583
public static function log($message, $options = array())
    {
        if (array_key_exists('inputs', $options)) {
            $inputs = $options['inputs'];
        } else {
            $inputs = array(
                self::getTimestamp(),
                'LOG',
                self::getFilename(),
                self::getLineNumber()
            );
        }

        if (!array_key_exists('output', $options)) {
            $options['output'] = 'STDOUT';
        }

        if (array_key_exists('format', $options)) {
            array_unshift($inputs, $options['format']);
        } else {
            array_unshift($inputs, self::$format);
        }

        $inputs[] = $message;

        $logMessage = self::getLogMessage($inputs);
        if (array_key_exists('colour', $options) && !empty($options['colour'])) {
            self::out($logMessage, $options['colour'], $options['output']);
        } else {
            self::out($logMessage, false, $options['output']);
        }
    }
127966
public static function output(string $message, string $interface = 'file')
    {
        $env = FEnv::get("framework.env");
        $file_debug = FEnv::get(("dev" === $env)? "framework.logs.debug.dev.file" :
            "framework.logs.debug.prod.file");
        if (self::$logstatus == true) {
            self::input($message);
            if ($interface == 'file') {
                $debug = array();
                $debug['time'] = self::$logformat['time'];
                $debug['content'] = self::$logformat['msg'];
                $log = (array) JL::open($file_debug);
                $c = count($log);
                $log[$c] = $debug;
                $log = (object) $log;
                JL::put(
                    $file_debug,
                    json_encode($log, JSON_PRETTY_PRINT)
                );

                JL::close($file_debug);
                return ((new Renderer())->textRenderer(" "));
            } elseif ($interface == 'screen') {
                return (new Renderer())->textRenderer("<br>Time : " . self::$logformat['time'] .
                    " ### Content : " . self::$logformat['msg'] . "<br>");
            } else {
                throw new Server500(new \ArrayObject(array("explain" => "Undefined interface $interface",
                    "solution" => "interface available for debug [file, screen]", "line_error" => "43")));
            }
        } else {
            return ((new Renderer())->textRenderer(" "));
        }
    }
81672
private function paintMessage($message)
    {
        $this->TCPDF->SetFont($this->reportFont, $this->reportFontStyle, $this->reportSimpleFontSize);
        $this->TCPDF->SetTextColor($this->reportTextColor[0], $this->reportTextColor[1], $this->reportTextColor[2]);
        $message = $this->formatText($message);
        $this->TCPDF->Write("1em", $message);
        $this->TCPDF->Ln();
    }
1103443
public function exec($command, $message = true, $output = true)
    {
        $shell_output = array();
        exec($command . ' 2>&1', $shell_output, $result);

        if (empty($result)) {
            if ($message) {
                $this->out('OK');
            }
        } else {
            if ($message) {
                $this->error('Error');
            }
        }

        if ($output) {
            $this->out(implode(PHP_EOL, $shell_output));
        }

        return $result;
    }
532085
static public function writeOutput($text, $color = '')
    {
        switch ($color) {
            case self::COLOR_WHITE:
                $out = "[0m";
                break;
            case self::COLOR_WHITE_BOLD:
                $out = "[1m";
                break;
            case self::COLOR_WHITE_DIM:
                $out = "[2m";
                break;
            case self::COLOR_RED:
                $out = "[0;31m";
                break;
            case self::COLOR_RED_BOLD:
                $out = "[1;31m";
                break;
            case self::COLOR_RED_DIM:
                $out = "[2;31m";
                break;
            case self::COLOR_GREEN:
                $out = "[0;32m";
                break;
            case self::COLOR_GREEN_BOLD:
                $out = "[1;32m";
                break;
            case self::COLOR_GREEN_DIM:
                $out = "[2;32m";
                break;
            case self::COLOR_YELLOW:
                $out = "[0;33m";
                break;
            case self::COLOR_YELLOW_BOLD:
                $out = "[1;33m";
                break;
            case self::COLOR_YELLOW_DIM:
                $out = "[2;33m";
                break;
            default:
                echo UString::newLine() . $text;

                return true;
        }

        echo UString::newLine() . chr(27) . $out . $text . chr(27) . "[0m";

        return true;
    }
1127712
private function error(OutputInterface $output, $message, $args = array())
    {
        /** @noinspection HtmlUnknownTag */
        $output->writeln('<error>' . sprintf($message, $args) . '</error>');
        exit(0);
    }
938397
protected function yell($text, $length = 40, $color = 'green') {
    $format = "<fg=white;bg=$color;options=bold>%s</fg=white;bg=$color;options=bold>";
    $this->formattedOutput($text, $length, $format);
  }
2743
public function output($message, $depth = 0) {
        foreach ($this->traces as $trace) {
            $trace->output($message, $depth);
        }
    }
1268845
def out(msg, error=False):
        "  "
        pipe = stdout
        if error:
            pipe = stderr
            msg = color_msg(msg, "warning")

        pipe.write("%s\n" % msg)
1143504
def plain_output(message, color)
      if @options['without-color']
        puts message
      else
        puts Colorize.send(color, message)
      end
    end
755331
final public static function outputAsNotice(string $message, string $exit = "yes")
    {
        $colors = self::getManagerColorInstance();
        echo "\n\n".$colors->getColoredString($message, "yellow", "transparent");
        if ($exit == "yes") {
            exit();
        }
    }