Output an error notification.

@param string $message the message to print out
@return string HTML fragment.
@see \core\output\notification
961723
public function notify_problem($message) {
        $n = new \core\output\notification($message, \core\output\notification::NOTIFY_ERROR);
        return $this->render($n);
    }
918942
protected static function output_msg($msg) {
        global $CFG, $PAGE;

        // If we are using the web interface we want pretty messages.
        if (!CLI_SCRIPT) {

            $renderer = $PAGE->get_renderer('tool_behat');
            echo $renderer->render_error($msg);

            // Stopping execution.
            exit(1);

        } else {

            // We continue execution after this.
            $clibehaterrorstr = "Ensure you set \$CFG->behat_* vars in config.php " .
                "and you ran admin/tool/behat/cli/init.php.\n" .
                "More info in " . self::DOCS_URL;

            echo 'Error: ' . $msg . "\n\n" . $clibehaterrorstr;
        }
    }
967898
public function logError($message)
    {
        if (func_num_args() > 1) {
            $message = $this->_prepareLogMessage(func_get_args());
        }

        return $this->_log(Zend_Log::ERR, $message);
    }
76365
public static function error($message, $die = true)
    {
        print sprintf("\033[31m%s\033[0m", '[eve] '.$message);
        print PHP_EOL;

        if($die) {
            print PHP_EOL;
            die(1);
        }
    }
1040099
public function writeLinePrompt($message)
    {
        $this->writeLine();

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

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

        $answer = $prompt->show();

        $this->writeLine();

        return $answer;
    }
127594
public static function html($message, $data = null)
    {
        if (!static::$on) {
            return;
        }

        echo "<hr>";
        echo "<i>";
            static::indent();
            echo "<b>" . static::getTime() . " - " . $message . "</b>";
            if (is_array($data)) {
                Html::print_r($data);
            } elseif ($data) {
                static::indent();
                echo "&nbsp;&nbsp;&nbsp;&nbsp;" . $data . "<br>";
            }
        echo "</i>";
    }
917697
protected function output($message, $color = null)
    {
        $format = [];
        if (!$this->isMuted()) {
            if ($color !== null) {
                $format[] = $color;
            }
            echo Console::ansiFormat("\r".$message."\n", $format);
        }
    }
197306
public static function output($message, $data = null)
    {
        if (static::$mode == "html") {
            static::html($message, $data);
        } else {
            static::text($message, $data);
        }
    }
583918
public static function exitWithErrorMessage($message)
    {
        Common::sendHeader('Content-Type: text/html; charset=utf-8');

        $message = str_replace("\n", "<br/>", $message);

        $output = "<html><body>".
            "<style>a{color:red;}</style>\n" .
            "<div style='color:red;font-size:120%; width:100%;margin: 30px;'>" .
            " <div style='width: 50px; float: left;'><img src='plugins/Morpheus/images/error_medium.png' /></div>" .
            "  <div style='margin-left: 70px; min-width: 950px;'>" .
            $message .
            "  </div>" .
            " </div>" .
            "</div>".
            "</body></html>";
        print($output);
        exit;
    }
773717
protected function stringifyMessage($message)
    {
        if (is_array($message) || is_object($message) || is_bool($message)) {
            return (string)var_export($message, true);
        }
        return (string)$message;
    }
152216
public static function error($message) {

        return (new Color())->getColoredString(sprintf(self::ERROR, self::date(), $message), 'red', 'white').PHP_EOL;
    }
289533
public static function searcherror($message)
    {
        if (self::$loadConfigs === false) {
            App::config('debug');
            self::$loadConfigs = true;
        }

        $link = App::env('searcherror');

        if (strpos($link, '%error%') === -1) {
            return $message;
        }

        return preg_replace_callback('#^([\s\S]+?)\s+in\s+([\s\S]+?:\d+)|^([\s\S]+?)$#', function ($matches) use ($link)
        {
            $error = empty($matches[3]) ? $matches[1] : $matches[3];

            $url = str_replace('%error%', urlencode($error), $link);
            $url = htmlentities($url);

            return '<a target="_blank" href="' . $url . '">' . $error . '</a>' .
                    (empty($matches[2]) ? '' : (' in ' . $matches[2]));

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

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

        return $thread->sendMessage($message);
    }
1199025
public function getNotifierForMessage(Message $message): Notifier
    {
        foreach ($this->notifiers as $notifier) {
            if ($notifier->handles($message)) {
                return $notifier;
            }
        }
        throw new NotifierNotFoundException();
    }
753006
public function warning($message)
    {
        $this->message = $message;
        $this->type = 'warning';
        $this->title = 'Warning';
        $this->icon = 'sl sl-icon-bell warning ln-notify-icon';

        return $this->setNotifier();
    }
386062
public function format($message) {
        $offset = 0;
        $output = '';
        $tagRegex = '[a-z][a-z0-9_=;-]*';
        preg_match_all("#<(($tagRegex) | /($tagRegex)?)>#isx", $message, $matches, PREG_OFFSET_CAPTURE);
        foreach ($matches[0] as $i => $match) {
            $pos = $match[1];
            $text = $match[0];

            if (0 != $pos && '\\' == $message[$pos - 1]) {
                continue;
            }

            $output .= $this->applyCurrentStyle(substr($message, $offset, $pos - $offset));
            $offset = $pos + strlen($text);

            if ($open = '/' != $text[1]) {
                $tag = $matches[1][$i][0];
            }
            else {
                $tag = isset($matches[3][$i][0]) ? $matches[3][$i][0] : '';
            }

            if (!$open && !$tag) {
                // </>
                $this->styleStack->pop();
            }
            elseif (false === $style = $this->createStyleFromString(strtolower($tag))) {
                $output .= $this->applyCurrentStyle($text);
            }
            elseif ($open) {
                $this->styleStack->push($style);
            }
            else {
                $this->styleStack->pop($style);
            }
        }

        $output .= $this->applyCurrentStyle(substr($message, $offset));

        return str_replace('\\<', '<', $output);
    }
1243022
public function setHTMLMessage($message)
    {
        if ($message === '') {
            throw new \InvalidArgumentException('$message must not be empty.', 1331488845);
        }

        if ($this->hasCssFile()) {
            $this->loadEmogrifierClass();
            $emogrifier = new Emogrifier($message, $this->getCssFile());
            $messageToStore = $emogrifier->emogrify();
        } else {
            $messageToStore = $message;
        }

        $this->setAsString('html_message', $messageToStore);
    }