Gets the name of the logging level.

@param  int $level

@return string
976833
public static function getLevelDisplayName($level)
    {
        $levels = Monolog::getLevels();
        if (in_array($level, $levels)) {
            $level = array_search($level, $levels);
            switch($level) {
                case 'DEBUG':
                    return tc(/*i18n: Detailed debug information */ 'Log level', 'Debug');
                case 'INFO':
                    return tc(/*i18n: Interesting events */ 'Log level', 'Info');
                case 'NOTICE':
                    return tc(/*i18n: Uncommon events */ 'Log level', 'Notice');
                case 'WARNING':
                    return tc(/*i18n: Exceptional occurrences that are not errors */ 'Log level', 'Warning');
                case 'ERROR':
                    return tc(/*i18n: Runtime errors */ 'Log level', 'Error');
                case 'CRITICAL':
                    return tc(/*i18n: Critical conditions */ 'Log level', 'Critical');
                case 'ALERT':
                    return tc(/*i18n: Action must be taken immediately */ 'Log level', 'Alert');
                case 'EMERGENCY':
                    return tc(/*i18n: Urgent alert */ 'Log level', 'Emergency');
            }
        }
    }
196991
public function getLogs($level = null)
	{
		// If no level was given, return all logs.
		if(is_null($level))
		{
			return $this->logs;
		}

		else
		{
			if(isset($this->logs[$level]))
			{
				return $this->logs[$level];
			}
		}

		// If the level doesn't exist, just return an empty array.
		//
		// @todo: check that the level exists, otherwise throw an exception. 
		return array();
	}
213644
public function withLogLevel($level)
    {
        $logger = clone $this;
        $logger->level = $this->convertLevel($level);
        return $logger;
    }
338444
public static function getLevelName($level) {
        $level = (int) $level;
        if (!isset(self::$_levels[$level])) {
            throw new CM_Exception_Invalid('Level is not defined', null, [
                'level'           => $level,
                'availableLevels' => implode(', ', array_keys(self::$_levels)),
            ]);
        }
        return self::$_levels[$level];
    }
1089652
protected function parseLevel( $level )
	{
		if ( isset( $this->levels[$level] ) )
			return $this->levels[$level];

		throw new InvalidArgumentException( 'Invalid log level.' );
	}
240554
public static function getErrorPrefix($level)
    {
        switch ($level) {
            case E_PARSE:
                $prefix = 'PHP Parse error';
                break;
            case E_ERROR:
            case E_CORE_ERROR:
            case E_COMPILE_ERROR:
                $prefix = 'PHP Fatal error';
                break;
            case E_USER_ERROR:
            case E_RECOVERABLE_ERROR:
                $prefix = 'PHP error';
                break;
            case E_WARNING:
            case E_CORE_WARNING:
            case E_COMPILE_WARNING:
            case E_USER_WARNING:
                $prefix = 'PHP Warning';
                break;
            case E_NOTICE:
            case E_USER_NOTICE:
                $prefix = 'PHP Notice';
                break;
            case E_STRICT:
                $prefix = 'PHP Debug';
                break;
            default:
                $prefix = 'PHP Notice';
        }
        return $prefix;
    }
284792
public static function getLevelName(int $level): string
    {
        if (!isset(static::$levels[$level])) {
            throw new InvalidArgumentException('Level "'.$level.'" is not defined, use one of: '.implode(', ', array_keys(static::$levels)));
        }

        return static::$levels[$level];
    }
326854
public static function getErrorLevelString($level)
    {
        switch ($level) {
            case E_PARSE:
                return 'CRITICAL';
            case E_ERROR:
            case E_CORE_ERROR:
            case E_COMPILE_ERROR:
            case E_USER_ERROR:
            case E_RECOVERABLE_ERROR:
                return 'ERROR';
            case E_WARNING:
            case E_CORE_WARNING:
            case E_COMPILE_WARNING:
            case E_USER_WARNING:
                return 'WARNING';
            case E_NOTICE:
            case E_USER_NOTICE:
                return 'NOTICE';
            case E_STRICT:
                return 'DEBUG';
            default:
                return 'NOTICE';
        }
    }
755487
public function getSubdomain(int $level = null)
    {
        $domain = $this->getDomain();

        if (is_null($domain)) {
            return null;
        }

        $return = substr($this->getHost(), 0, -strlen($this->getDomain()) - 1);

        if (!$return) {
            return null;
        }

        if (is_null($level)) {
            return $return;
        }

        return implode('.', array_slice(
            explode('.', $return),
            $level > 0 ? 0 : $level,
            1
        ));
    }
556864
protected function getCallerByLevel($level)
    {
        $level+=1;
        $backtrace=debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, static::MAX_TRACE_LEVEL);
        $caller_class=$backtrace[$level]['class']??'';
        if ($this->dn_class && (is_subclass_of($this->dn_class, $caller_class) || $this->dn_class===$caller_class)) {
            $caller_class=$backtrace[$level+1]['class']??'';
        }
          

        return $caller_class;
    }
42601
private function getLevel($level)
    {
        $result = \common_Logger::TRACE_LEVEL;
        switch ($level) {
            case 'fatal' :
                $result = \common_Logger::FATAL_LEVEL;
                break;
            case 'error' :
                $result = \common_Logger::ERROR_LEVEL;
                break;
            case 'warn' :
                $result = \common_Logger::WARNING_LEVEL;
                break;
            case 'info' :
                $result = \common_Logger::INFO_LEVEL;
                break;
            case 'debug' :
                $result = \common_Logger::DEBUG_LEVEL;
                break;
            case 'trace' :
                $result = \common_Logger::DEBUG_LEVEL;
                break;
        }
        return $result;
    }
1177485
protected function getLogLevel($logLevel)
    {
        switch ($logLevel) {
            case Logger::DEBUG:
                return Severity::debug();
            case Logger::INFO:
                return Severity::info();
            case Logger::NOTICE:
                return Severity::info();
            case Logger::WARNING:
                return Severity::warning();
            case Logger::ERROR:
                return Severity::error();
            case Logger::CRITICAL:
                return Severity::fatal();
            case Logger::ALERT:
                return Severity::fatal();
            case Logger::EMERGENCY:
                return Severity::fatal();

        }
    }
601433
public static function toNumberLevel($level)
    {
        if (\is_string($level) && \defined(__CLASS__ . '::' . strtoupper($level))) {
            return \constant(__CLASS__ . '::' . strtoupper($level));
        }

        return $level;
    }
1150651
private static function levelToPriority($level)
    {
        switch ($level) {
            case LogLevel::EMERGENCY:
                return LOG_EMERG;
            case LogLevel::ALERT:
                return LOG_ALERT;
            case LogLevel::CRITICAL:
                return LOG_CRIT;
            case LogLevel::ERROR:
                return LOG_ERR;
            case LogLevel::WARNING:
                return LOG_WARNING;
            case LogLevel::NOTICE:
                return LOG_NOTICE;
            case LogLevel::INFO:
                return LOG_INFO;
            case LogLevel::DEBUG:
                return LOG_DEBUG;
            default:
                throw new RuntimeException('unknown log level');
        }
    }
1088564
public function getXp(int $level)
    {
        $xpTable = $this->getXpTable();

        if (!isset($xpTable[$level])) {
            return false;
        }

        return $xpTable[$level];
    }
426663
public static function toMonologLevel($level)
    {
        if (is_string($level) && defined(__CLASS__.'::'.strtoupper($level))) {
            return constant(__CLASS__.'::'.strtoupper($level));
        }

        return $level;
    }
709167
function getPrevLevel($level)
    {
        $levels = $this->getLevels();
        $level_incdeces = $this->getLevelIndeces();
        $level_index = $level_incdeces[$level];
        if (!isset($levels[$level_index - 1])) {
            return false;
        }
        $prev_level = $levels[$level_index - 1];
        return $prev_level;
    }