Format message for singing.

@param Message $message
@return void
195555
private function formatMessage(Message &$message)
    {
        $body = $message->getBody();

        if ($body instanceof MimeMessage) {
            $body = $body->generateMessage();
        }

        $body = $this->normalizeNewlines($body);

        $message->setBody($body);
    }
352224
public function format(string $level, string $message, array $context)
    {
        if ($this->formatter !== null)
            return $this->formatter->format($level, $message, $context);

        // Fall back to the logger placeholder filler
        return Logger::fillPlaceholders($message, $context);
    }
838509
public static function message(Message $message): void
    {
        static::init();

        foreach (static::$adapters as $adapter) {
            /* @var $adapter \Koldy\Log\Adapter\AbstractLogAdapter */
            if ($adapter->isLevelEnabled($message->getLevel())) {
                $adapter->logMessage($message);
            }
        }
    }
678575
public function title(string $message)
    {
        $this->style->newLine();
        $this->output->writeln(sprintf(
            '<highlight>>></> <title>%s</>',
            OutputFormatter::escapeTrailingBackslash(strtoupper($message))
        ));
        $this->style->newLine();
    }
267316
private function overwrite(string $message): void
    {
        if ($this->overwrite) {
            if (!$this->firstRun) {
                if ($this->output instanceof ConsoleSectionOutput) {
                    $lines = floor(Helper::strlen($message) / $this->terminal->getWidth()) + $this->formatLineCount + 1;
                    $this->output->clear($lines);
                } else {
                    // Erase previous lines
                    if ($this->formatLineCount > 0) {
                        $message = str_repeat("\x1B[1A\x1B[2K", $this->formatLineCount).$message;
                    }

                    // Move the cursor to the beginning of the line and erase the line
                    $message = "\x0D\x1B[2K$message";
                }
            }
        } elseif ($this->step > 0) {
            $message = PHP_EOL.$message;
        }

        $this->firstRun = false;

        $this->output->write($message);
    }
905533
public function setMessages( $messages )
	{
		foreach( $messages as $code => $label )
			$this->messages[$code]	= $label;
	}
1147777
protected function log($message)
    {
        if (method_exists($this->io, 'writeError')) {
            $this->io->writeError($message);
        }
        else {
            // @codeCoverageIgnoreStart
            $this->io->write($message);
            // @codeCoverageIgnoreEn
        }
    }
23576
private function formatMessage(&$message)
    {
        if ($this->extraMessage) {
            $message = array_merge($message, $this->extraMessage->toArray());
        }

        foreach ($this->options as $option => $value) {
            Arr::set($message, $option, $value);
        }
    }
1262182
public static function formatMessage($message): string
    {
        if ($message instanceof \Throwable) {
            while ($message) {
                $tmp[] = ($message instanceof \ErrorException
                        ? Helpers::errorTypeToString($message->getSeverity()) . ': ' . $message->getMessage()
                        : Helpers::getClass($message) . ': ' . $message->getMessage() . ($message->getCode() ? ' #' . $message->getCode() : '')
                    ) . ' in ' . $message->getFile() . ':' . $message->getLine();
                $message = $message->getPrevious();
            }
            $message = \implode("\ncaused by ", $tmp);

        } elseif (!\is_string($message)) {
            $message = self::toText($message);
        }

        return \trim($message);
    }
735665
public function validate(Message $message)
    {
        if ($message->getTitleLength() > self::CHARACTER_LIMIT) {
            $message->addStatus(new SoftLimitTheTitleLengthTo50CharactersStatus());
        }
    }
1024931
protected function formatMessage( $message )
	{
		if ( is_array( $message ) )
			return var_export( $message, true );
		elseif ( $message instanceof Jsonable )
			return $message->toJson();
		elseif ( $message instanceof Arrayable )
			return var_export( $message->toArray(), true );

		return $message;
	}
217976
public function markAsDisappeared($message = null)
    {
        if (!is_null($message)) {
            $this->setMessages($message);
        }
        $this
            ->setStatus(self::STATUS_DISAPPEARED)
            ->setFinishedAt($this->getLastSeen())
            ->save();

        $this->log(sprintf('Job "%s" (id: %s) disappeared. Message: %s', $this->getJobCode(), $this->getId(), $message));
    }
1190194
public function warning($message): void
	{
		$message = $this->logMessToArray($message);
		$this->log(array_merge(['SEVERITY' => 'WARNING'], $message));
	}
719313
public function record(EventMessage $message): void
    {
        $eventRecord = new EventRecord(
            $message,
            $this->aggregateId,
            $this->aggregateType,
            $this->nextSequence()
        );
        $this->lastSequence = $eventRecord->sequenceNumber();
        $this->eventRecords->add($eventRecord);
    }
892805
public function log($message)
    {
        $formattedMessage = $this->formatMessage($message);
        if (!empty($formattedMessage)) {
            $this->logger->info($formattedMessage);
        }
    }
1284498
protected function addMessage($message) {
		$hash = crc32(json_encode(func_get_args()));
		
		if (isset($this->_messages[$hash])) {
			return;
		}
		
		if (func_num_args() > 1) {
			$this->_messages[$hash] = call_user_func_array('sprintf', func_get_args());
		} else {
			$this->_messages[$hash] = (string) $message;
		}
	}
931073
protected function formatMessage($message, $value)
    {
        $type = class_exists($this->type) ? get_class($value) : gettype($value);

        return sprintf($message, $this->type, $type);
    }