Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/yandex.market/lib/logger/ |
Upload File : |
<?php namespace Yandex\Market\Logger; use Yandex\Market; use Yandex\Market\Reference\Concerns; class Level extends Market\Psr\Log\LogLevel { use Concerns\HasMessage; protected static $variantsMap; protected static $variants = [ self::EMERGENCY, self::ALERT, self::CRITICAL, self::ERROR, self::WARNING, self::INFO, self::NOTICE, self::DEBUG, ]; public static function getVariants() { return static::$variants; } public static function getTitle($level) { return self::getMessage(mb_strtoupper($level)); } public static function isMatch($limit, $target) { $limitLevel = static::getVariantLevel($limit); $targetLevel = static::getVariantLevel($target); return ( $limitLevel !== null && $targetLevel !== null && $limitLevel >= $targetLevel ); } protected static function getVariantsMap() { if (static::$variantsMap === null) { static::$variantsMap = array_flip(static::$variants); } return static::$variantsMap; } protected static function getVariantLevel($level) { $map = static::getVariantsMap(); return isset($map[$level]) ? $map[$level] : null; } }