@param $level

@return bool
969481
public function validateLevel($level)
    {
        if (!in_array($level, array(Notification::LVL_DEBUG, Notification::LVL_INFO, Notification::LVL_WARNING, Notification::LVL_ERROR, Notification::LVL_PANIC))) {
            $this->addError('level', 'Invalid level value');

            return false;
        }

        return true;
    }
1089652
protected function parseLevel( $level )
	{
		if ( isset( $this->levels[$level] ) )
			return $this->levels[$level];

		throw new InvalidArgumentException( 'Invalid log level.' );
	}
993014
public function level($level, $operator = '>=')
	{
		if (!$this->user())
		{
			return false;
		}

		$userCaps = array_keys($this->getUser()->allcaps);

		foreach ($userCaps as $cap)
		{
			// get just the first, higher
			if (substr($cap, 0, 6) === 'level_')
			{
				return $this->checkWithOperator(substr($cap, 6), $level, $operator);
			}
		}

		return false;
	}
311766
private function isChannelRegisterWithLogger($id, $level)
    {
        if (!isset($this->loggersChannel[$id])) {
            return true;
        }

        if ($this->isChannelTypeOf('inclusive', $id)) {
            return $this->levelExistsInList($level, $id);
        }

        if ($this->isChannelTypeOf('exclusive', $id)) {
            return !$this->levelExistsInList($level, $id);
        }

        return false;
    }
1116497
protected function write($object, $level)
    {
        if ($this->enabled && $this->writer && $level <= $this->level) {
            return $this->writer->write($object, $level);
        } else {
            return false;
        }
    }
1344420
private function loggerLevel($level)
    {
        switch ($level) {
            case 'trace':
            case 'debug':
                return Logger::DEBUG;
                break;

            case 'info':
                return Logger::INFO;
                break;

            case 'notice':
                return Logger::NOTICE;
                break;

            case 'warn':
            case 'warning':
                return Logger::WARNING;
                break;

            case 'error':
                return Logger::ERROR;
                break;

            case 'crit':
            case 'critical':
                return Logger::CRITICAL;
                break;

            case 'alert':
                return Logger::ALERT;
                break;

            case 'emergency':
                return Logger::EMERGENCY;
                break;

            default:
                throw new \Exception('Unknown Log Level', 1);
                break;
        }
    }
1070215
public function getParentByLevel($level = 1)
    {
        if ($level === $this->getLvl()) {
            return $this;
        }

        if (!$this->getParent()) {
            return false;
        }

        if ($level === $this->getParent()->getLvl()) {
            return $this->getParent();
        }

        return $this->getParent()->getParentByLevel($level);
    }
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;
    }
169655
public function isSuccess($level = HealthCheckTestResultInterface::WARNING)
    {
        /** @var HealthCheckTestResultInterface $result */
        foreach ($this->results as $result) {
            if (true === $result->isError() && $result->getLevel() >= $level){
                return false;
            }
        }

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

        return $level;
    }
978146
public function setNestingLevel($level = null)
	{
		if (func_num_args() and is_numeric($level) and $level > 0)
		{
			$this->maxNestingLevel = $level;
		}

		return $this->maxNestingLevel;
	}
1085896
private function validateSeverity($level)
    {
        $validLevels = [
            LogLevel::EMERGENCY,
            LogLevel::ALERT,
            LogLevel::CRITICAL,
            LogLevel::ERROR,
            LogLevel::WARNING,
            LogLevel::NOTICE,
            LogLevel::INFO,
            LogLevel::DEBUG
        ];

        return in_array($level, $validLevels, true) ? $level : LogLevel::ERROR;
    }
213644
public function withLogLevel($level)
    {
        $logger = clone $this;
        $logger->level = $this->convertLevel($level);
        return $logger;
    }
982886
public static function getLevel($level = null) {

        $level = strtoupper($level);

        if ( array_key_exists($level, self::$levels) ) return self::$levels[$level];

        return self::$levels[self::DEFAULT_LOG_LEVEL];

    }
1159203
protected function isPropertyAccessibilityLevelValid(int $level) : bool
    {
        if ($level == AccessibilityLevels::PUBLIC_LEVEL ||
            $level ==  AccessibilityLevels::PROTECTED_LEVEL ||
            $level == AccessibilityLevels::PRIVATE_LEVEL
        ) {
            return true;
        }

        return false;
    }
444082
public function isAddressChanged($level = 1)
    {
        $fields = ['Address', 'Address2', 'City', 'State', 'PostalCode', 'Country'];
        $changed = $this->owner->getChangedFields(false, $level);
        foreach ($fields as $field) {
            if (array_key_exists($field, $changed)) {
                return true;
            }
        }

        return false;
    }
206986
public function get($level = null)
    {
        if (isset($level)) {
            return $this->getMessage();
        }

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