Write output message

@param array|string $message

@return $this|bool
333016
protected function writeOutput($message)
    {
        if (is_null($this->output)) {
            return false;
        }

        $this->output->writeln($message);

        return $this;
    }
531568
public function sendMessage(string $message) : ?Message 
    {
        $thread = $this->messageGroup();

        if ($thread === null) return null;

        return $thread->sendMessage($message);
    }
227112
public function sendRequest(array $message): bool
    {
        try {
            $recipient = preg_replace('/\s+/', '', $message['to']) . "@" . $this->endpoint;
            $this->mailer->send($recipient, $message['content']);
            return true;
        } catch (\Exception $e) {
            return false;
        }
    }
255470
protected function error($message)
    {
        if ($this->output instanceof ConsoleOutputInterface) {
            $this->output->getErrorOutput()->writeln("<error>$message</error>");
        } else {
            $this->output->writeln("<error>$message</error>");
        }
    }
687671
protected function write($message, array $record = array())
    {
        $record = array_merge($this->defautlRecord, $record);
        $record['msg'] = $message;
        $this->output->writeln($this->formatter->format($record));
    }
882819
public function writeSelectPrompt($message, &$options)
    {
        $this->writeLine();

        // translate options
        foreach ($options as $optionKey => $optionValue) {
            $options[$optionKey] = $this->translator->translate($optionValue);
        }

        // write prompt badge
        $this->writeBadge('badge_pick', Color::RED);

        // output prompt
        $prompt = new Select(
            $this->translator->translate($message),
            $options,
            false,
            false
        );

        $answer = $prompt->show();

        $this->writeLine();

        return strtolower($answer);
    }
1091173
public function write($message, $options = 0)
    {
        if ($message instanceof \Exception || (interface_exists('\Throwable') && $message instanceof \Throwable)) {
            echo $message;
            return $this;
        } elseif ($message instanceof \JsonSerializable) {
            echo json_encode($message, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
            return $this;
        } elseif ($message instanceof \Serializable) {
            echo serialize($message);
            return $this;
        } elseif (!is_array($message)) {
            echo (string)$message;
            return $this;
        }

        if (!isset($message[0]) || !is_string($message[0])) {
            echo json_encode($message, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
            return $this;
        }

        if (substr_count($message[0], '%') + 1 >= ($count = count($message)) && isset($message[$count - 1])) {
            foreach ((array)$message as $k => $v) {
                if ($k === 0 || is_scalar($v) || $v === null) {
                    continue;
                }

                if ($v instanceof \Exception || (interface_exists('\Throwable') && $v instanceof \Throwable)) {
                    $message[$k] = (string)$v;
                } elseif (is_array($v) || $v instanceof \JsonSerializable) {
                    $message[$k] = json_encode($v, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
                }
            }
            /** @noinspection ArgumentUnpackingCanBeUsedInspection */
            echo call_user_func_array('sprintf', $message);

            return $this;
        }

        if (count($message) === 2) {
            if (isset($message[1]) && strpos($message[0], ':1') === false) {
                if (is_scalar($message[1])) {
                    echo json_encode($message, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
                    return $this;
                } else {
                    $message[0] = rtrim($message[0], ': ') . ': :1';
                }
            }
        } elseif (count($message) === 3) {
            if (isset($message[1], $message[2]) && strpos($message[0], ':1') === false) {
                if (is_scalar($message[1]) && !is_scalar($message[2])) {
                    $message[0] = rtrim($message[0], ': ') . ': :1 => :2';
                } else {
                    echo json_encode($message, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
                    return $this;
                }
            }
        }

        if (strpos($message[0], ':') === false) {
            echo $this->colorize($message[0], $options);
        } else {
            $replaces = [];

            foreach ((array)$message as $k => $v) {
                if ($k === 0) {
                    continue;
                }

                if (is_int($v)) {
                    if (!$options && strpos($v, "\033[") === false) {
                        $v = $this->colorize($v, self::FC_GREEN);
                    }
                } elseif (is_string($v)) {
                    if (!$options && strpos($v, "\033[") === false) {
                        $v = $this->colorize($v, self::FC_CYAN);
                    }
                } elseif ($v instanceof \Exception || (interface_exists('\Throwable') && $v instanceof \Throwable)) {
                    $v = (string)$v;
                } elseif (is_array($v) || $v instanceof \JsonSerializable) {
                    $v = json_encode($v, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
                } elseif ($v instanceof \Serializable) {
                    $v = serialize($v);
                } elseif ($v === null || is_scalar($v)) {
                    $v = json_encode($v);
                } else {
                    $v = (string)$v;
                }

                $replaces[':' . $k] = $v;
            }

            echo $this->colorize(strtr($message[0], $replaces), $options);
        }

        return $this;
    }
313221
public function a($message) {
        return isset($this->messages[$message]) ? $this->messages[$message] : $message;
    }
922384
private function notify($message)
    {
        if ($this->output !== null) {
            $this->output->writeln("<info>{$message}</info>");
        }

        $this->app['logger.system']->info($message, ['event' => 'cron']);
    }
713110
public function setMessage($message)
    {
        if (is_object($message)) {
            $message = (new ConvertObject($message))
                ->toArray();
        }
        $this->message = $message;
        return $this;
    }
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));
        }
    }
689724
protected function writeLog($message)
    {
        $fileName = 'app/logs/mail/error.log';

        $log = sprintf("[%s]: %s\n", date_format(new \DateTime(), 'Y-m-d H:i:s'), $message);
        file_put_contents($fileName, $log, FILE_APPEND);
    }
534426
public function setStatusMessage($message)
    {
        if($entity = $this->getIterator()->current()) {
            $entity->setStatusMessage($message);
        }

        return $this;
    }
126283
protected function doWrite($message, $newline, $stream = null) {
        if (null === $stream) {
            $stream = $this->stdout;
        }
        if (false === @fwrite($stream, $message . ($newline ? PHP_EOL : ''))) {
            throw new \RuntimeException('Unable to write output.');
        }

        fflush($stream);
    }
773717
protected function stringifyMessage($message)
    {
        if (is_array($message) || is_object($message) || is_bool($message)) {
            return (string)var_export($message, true);
        }
        return (string)$message;
    }
1245337
protected function buildMessage (array $message)
    {
        $doc = new DOMDocument();
        $root = $doc->createElement('xml');
        $doc->appendChild($root);
        
        $message = array_merge(
            $message,
            ['FromUserName' => $this->sender, 'ToUserName' => $this->recipient, 'CreateTime' => time()]
        );
        
        $this->fillElement($doc, $root, $message);
        
        return $doc->saveXML($doc->documentElement);
    }
117804
public function stdout($message, $int = 0)
    {
        if (is_array($message))
        {
            $this->_stdouts[] = print_r($message, true);
        } else
        {
            $this->_stdouts[] = $message;
        }

        return $this;
    }