Returns the PSR log level based on the common log level.

@param string $level

@return string   The PSR log level.

@throws Exception   When invalid level was presented.
10735
public static function getPsrLevelFromCommon($level)
    {
        if (empty(self::$reverseMap[$level])) {
            throw new Exception('Invalid error level in PSR to Common level conversion: ' . $level);
        }

        return self::$reverseMap[$level];
    }
898318
protected function checkLevel($level)
    {
        $cfgLevel = $this->registry->get(
            'level', self::DEFAULT_LEVEL
        );
        if (is_numeric($cfgLevel)) {
            $cfgLevel = (int)$cfgLevel;
        } else if (
            is_string($cfgLevel) &&
            preg_match('/^[A-Z_&|^ ]+$/', $cfgLevel)
        ) {
            $cfgLevel = eval(sprintf("return %s;", $cfgLevel));
        } else {
            throw new \RuntimeException(sprintf(
                "Invalid log level '%s' passed!", $cfgLevel
            ));
        }
        $result = (bool)($cfgLevel & $level);

        return $result;
    }
563354
public static function logLevel($level)
    {
        if (is_numeric($level)) {
            if ($level == Teamspeak::LOGLEVEL_CRITICAL) {
                return "CRITICAL";
            }
            if ($level == Teamspeak::LOGLEVEL_ERROR) {
                return "ERROR";
            }
            if ($level == Teamspeak::LOGLEVEL_DEBUG) {
                return "DEBUG";
            }
            if ($level == Teamspeak::LOGLEVEL_WARNING) {
                return "WARNING";
            }
            if ($level == Teamspeak::LOGLEVEL_INFO) {
                return "INFO";
            }

            return "DEVELOP";
        } else {
            if (strtoupper($level) == "CRITICAL") {
                return Teamspeak::LOGLEVEL_CRITICAL;
            }
            if (strtoupper($level) == "ERROR") {
                return Teamspeak::LOGLEVEL_ERROR;
            }
            if (strtoupper($level) == "DEBUG") {
                return Teamspeak::LOGLEVEL_DEBUG;
            }
            if (strtoupper($level) == "WARNING") {
                return Teamspeak::LOGLEVEL_WARNING;
            }
            if (strtoupper($level) == "INFO") {
                return Teamspeak::LOGLEVEL_INFO;
            }

            return Teamspeak::LOGLEVEL_DEVEL;
        }
    }
1158316
public function secure($level)
    {
        if ($level < 1 || $level > 3) {
            throw new Exception('Invalid security level', 2);
        }

        $this->levelSecure = (int) $level;

        return $this;
    }
361451
protected function normalizeLevel($level)
    {
        if (isset($this->logLevelMap[$level])) {
            return $this->logLevelMap[$level];
        }
        return strtolower($level);
    }
1013494
public function log($level, $message, array $context = [])
    {
        if (is_string($level)) {
            if (!array_key_exists($level, $this->levels)) {
                throw new \Exception("Log level {$level} is not valid. Please use syslog levels instead", 500);
            } else {
                $level = $this->levels[$level];
            }
        }
        if (array_key_exists('exception', $context)) {
            if ($context['exception'] instanceof \Exception) {
                $exc = $context['exception'];
                $message .= " Exception: {$exc->getMessage()}";
                unset($context['exception']);
            } else {
                unset($context['exception']);
            }
        }
        $level = $this->s_levels[$level];

        return  $this->interpolate($message, $context, $level);
    }
999053
public static function getLevelName($level)
    {
        static $levels = [
            Logger::LEVEL_ERROR => 'error',
            Logger::LEVEL_WARNING => 'warning',
            Logger::LEVEL_INFO => 'info',
            Logger::LEVEL_TRACE => 'debug',
            Logger::LEVEL_PROFILE_BEGIN => 'debug',
            Logger::LEVEL_PROFILE_END => 'debug',
        ];

        return isset($levels[$level]) ? $levels[$level] : 'error';
    }
900436
public static function log ($message, $level = null) {
		$level = ($level !== null) ? $level : self::$default_level;
		return self::write (self::get_struct ($message, $level));
	}
568005
public static function getLevelSeverity($level)
    {
        if (($index = array_search($level, self::getValues(), true)) === false) {
            throw new \InvalidArgumentException(sprintf('Unknown level "%s"', $level));
        }

        return $index;
    }
840867
public function levelToXp($level)
    {
        $xp = 0;

        for ($i = 1; $i < $level; $i++) {
            $xp += floor($i + 300 * pow(2, ($i / 7)));
        }

        $xp = floor($xp / 4);

        // Check if our value is above 200m, if so return 200m, otherwise our value
        return ($xp > 200000000 ? 200000000 : $xp);
    }
157259
public function getXmlClassificationName($level)
    {
        if ($this->getXmlData()->processInformation->dataSetInformation->classificationInformation->classification->class) {
            foreach ($this->getXmlData()->processInformation->dataSetInformation->classificationInformation->classification->class as $classification) {
                if ($classification->attributes()->level == $level) {
                    return (string) $classification;
                }
            }
        }

        return null;
    }
188750
public function getParent($level = -1)
    {
        if (-1 === $level) {
            return $this->parent;
        }

        $parents = $this->getParents();

        if ($level < 0) {
            $level = count($parents) + $level;
        }

        return isset($parents[$level]) ? $parents[$level] : null;
    }
521504
public function getLogLevelName($level):string
    {
        return isset(self::$levels[$level])?self::$levels[$level]:'';
    }
301609
private function convertLevel($level)
    {
        # If this is one of the defined string log levels then return it's numeric value
        if (!array_key_exists($level, $this->levels)) {
            throw new InvalidArgumentException("Unknown log level: {$level}");
        }

        return $this->levels[$level];
    }
553194
private function getLogLevel(Throwable $e): string
    {
        if ($e instanceof ErrorException && array_key_exists($e->getSeverity(), $this->levelMap)) {
            return $this->levelMap[$e->getSeverity()];
        }

        // default log level for Throwable
        return LogLevel::CRITICAL;
    }
1234856
protected function _checkLogLevel( $level )
	{
		switch( $level )
		{
			case MW_Logger_Abstract::EMERG:
			case MW_Logger_Abstract::ALERT:
			case MW_Logger_Abstract::CRIT:
			case MW_Logger_Abstract::ERR:
			case MW_Logger_Abstract::WARN:
			case MW_Logger_Abstract::NOTICE:
			case MW_Logger_Abstract::INFO:
			case MW_Logger_Abstract::DEBUG:
				break;
			default:
				throw new MW_Logger_Exception( sprintf( 'Invalid log level constant "%1$d"', $level ) );
		}
	}
206986
public function get($level = null)
    {
        if (isset($level)) {
            return $this->getMessage();
        }

        return $this->current->where('level', $level);
    }