pocketmine\utils\MainLogger::critical PHP Method

critical() public method

public critical ( $message, $name = "CRITICAL" )
    public function critical($message, $name = "CRITICAL")
    {
        $this->send($message, \LogLevel::CRITICAL, $name, TextFormat::RED);
    }

Usage Example

コード例 #1
0
             foreach ($args as $name => $value) {
                 $params .= (\is_object($value) ? \get_class($value) . " " . (\method_exists($value, "__toString") ? $value->__toString() : "object") : \gettype($value) . " " . (\is_array($value) ? "Array()" : Utils::printable(@\strval($value)))) . ", ";
             }
         }
         $messages[] = "#{$j} " . (isset($trace[$i]["file"]) ? cleanPath($trace[$i]["file"]) : "") . "(" . (isset($trace[$i]["line"]) ? $trace[$i]["line"] : "") . "): " . (isset($trace[$i]["class"]) ? $trace[$i]["class"] . (($trace[$i]["type"] === "dynamic" or $trace[$i]["type"] === "->") ? "->" : "::") : "") . $trace[$i]["function"] . "(" . Utils::printable(\substr($params, 0, -2)) . ")";
     }
     return $messages;
 }
 function cleanPath($path)
 {
     return \rtrim(\str_replace(["\\", ".php", "phar://", \rtrim(\str_replace(["\\", "phar://"], ["/", ""], \pocketmine\PATH), "/"), \rtrim(\str_replace(["\\", "phar://"], ["/", ""], \pocketmine\PLUGIN_PATH), "/")], ["/", "", "", "", ""], $path), "/");
 }
 \set_error_handler([\ExceptionHandler::class, "handler"], -1);
 $errors = 0;
 if (\version_compare("5.6.0", PHP_VERSION) > 0) {
     $logger->critical("You must use PHP >= 5.6");
     ++$errors;
 }
 if (\php_sapi_name() !== "cli") {
     $logger->critical("You must run PocketMine-MP using the CLI.");
     ++$errors;
 }
 if (!\extension_loaded("sockets")) {
     $logger->critical("Unable to find the Socket extension.");
     ++$errors;
 }
 $pthreads_version = \phpversion("pthreads");
 if (\substr_count($pthreads_version, ".") < 2) {
     $pthreads_version = "0.{$pthreads_version}";
 }
 if (\version_compare($pthreads_version, "2.0.9") < 0) {
All Usage Examples Of pocketmine\utils\MainLogger::critical