当前位置: 首页>>代码示例>>PHP>>正文


PHP MainLogger::critical方法代码示例

本文整理汇总了PHP中pocketmine\utils\MainLogger::critical方法的典型用法代码示例。如果您正苦于以下问题:PHP MainLogger::critical方法的具体用法?PHP MainLogger::critical怎么用?PHP MainLogger::critical使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pocketmine\utils\MainLogger的用法示例。


在下文中一共展示了MainLogger::critical方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: foreach

             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) {
开发者ID:VonHirsch,项目名称:PocketMine-0.13.0,代码行数:31,代码来源:PocketMine.php

示例2: foreach

             }
             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), "/");
 }
 $errors = 0;
 if (php_sapi_name() !== "cli") {
     $logger->critical("You must run ImagicalMine 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, "3.1.5") < 0) {
     $logger->critical("pthreads >= 3.1.5 is required, while you have {$pthreads_version}.");
     ++$errors;
 }
 if (!extension_loaded("uopz")) {
开发者ID:Cecil107,项目名称:PocketMine-0.13.0,代码行数:31,代码来源:PocketMine.php


注:本文中的pocketmine\utils\MainLogger::critical方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。