Returns numeric level code for given log-level.

@param string $level
@return int
500727
public function getLevelCode(string $level): int
    {
        if ($this->levelIsValid($level) === false) {
            throw new \InvalidArgumentException('Invalid log-level provided.');
        }
        return array_search($level, $this->levels);
    }
426663
public static function toMonologLevel($level)
    {
        if (is_string($level) && defined(__CLASS__.'::'.strtoupper($level))) {
            return constant(__CLASS__.'::'.strtoupper($level));
        }

        return $level;
    }
1325645
protected function parseVerbosity($level = null)
    {
        if (isset($this->verbosityMap[$level])) {
            $level = $this->verbosityMap[$level];
        } elseif (! is_int($level)) {
            $level = $this->verbosity;
        }

        return $level;
    }
128259
private function get_log_level( $level, $log_level ) {
		if ( ! isset( $log_level[ $level ] ) && ! isset( $log_level[''] ) ) {
			return 'info';
		}
		'' === $level || ! isset( $log_level[ $level ] ) and $level = $log_level[''];
		if ( empty( $log_level[ $level ] ) ) {
			return 'info';
		}

		return $level;
	}
1309529
def getLogLevelNo(level):
    """"""
    if isinstance(level,(int,long)):
        return level
    try:
        return(int(logging.getLevelName(level.upper())))
    except:
        raise ValueError('illegal loglevel %s' % level)
192260
protected function getLogLevel($code = null)
    {
        switch ($code) {
            case E_STRICT:
            case E_DEPRECATED:
            case E_USER_DEPRECATED:
                return LogLevel::INFO;
            
            case E_NOTICE:
            case E_USER_NOTICE:
                return LogLevel::NOTICE;
                
            case E_WARNING:
            case E_CORE_WARNING:
            case E_COMPILE_WARNING:
            case E_USER_WARNING:
                return LogLevel::WARNING;
            
            case E_PARSE:
            case E_CORE_ERROR:
            case E_COMPILE_ERROR:
                return LogLevel::CRITICAL;
            
            default:
                return LogLevel::ERROR;
        }
    }
1292123
public function setLogLevel($level= xPDO::LOG_LEVEL_FATAL) {
        $oldLevel = $this->logLevel;
        $this->logLevel= intval($level);
        return $oldLevel;
    }
756584
public static function caller($level = 0)
    {
        $trace = debug_backtrace(0);

        if ($level < 0) {
            return $trace;
        } elseif (empty($trace[$level])) {
            return null;
        } elseif (empty($trace[$level]['file'])) {
            $level = 1;
        }

        $file = $trace[$level]['file'];
        $line = $trace[$level]['line'];

        $trace = null;

        return array(
            'file' => $file,
            'line' => $line
        );
    }
957171
protected static function _getLogLevel( $level = LoggingLevels::INFO, $fullName = false )
    {
        static $_logLevels = null;

        if ( empty( $_logLevels ) )
        {
            $_logLevels = LoggingLevels::getDefinedConstants();
        }

        $_levels = ( is_string( $level ) ? $_logLevels : array_flip( $_logLevels ) );

        if ( null === ( $_tag = Option::get( $_levels, $level ) ) )
        {
            $_tag = 'INFO';
        }

        return ( false === $fullName ? substr( strtoupper( $_tag ), 0, 4 ) : $_tag );
    }
447195
private function getLogLevel()
    {
        switch (Environment::LOG_LEVEL) {
            case "emergency":
                $this->logLevel = 8;
                break;
            case "alert":
                $this->logLevel = 7;
                break;
            case "critical":
                $this->logLevel = 6;
                break;
            case "error":
                $this->logLevel = 5;
                break;
            case "warning":
                $this->logLevel = 4;
                break;
            case "notice":
                $this->logLevel = 3;
                break;
            case "info":
                $this->logLevel = 2;
                break;
            case "debug":
                $this->logLevel = 1;
                break;
            default:
                $this->logLevel = 1;
                break;
        }
    }
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();
	}
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];

    }
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';
        }
    }
21267
protected function getLevelByType($type)
    {
        $level = 0;

        if (isset($this->availableLogtypes[$type])) {
            $level = $this->availableLogtypes[$type];
        }

        return $level;
    }
602047
public static function getLevelName($level)
    {
        $level = (int) $level;
        foreach (static::$levelNameToLevel as $levelName => $currentLevel) {
            if ($level >= $currentLevel) {
                return $levelName;
            }
        }

        return static::$levelNameToLevel[static::ALL];
    }
521504
public function getLogLevelName($level):string
    {
        return isset(self::$levels[$level])?self::$levels[$level]:'';
    }
420882
public static function getLevelCode(
        /*# string */ $level
    )/*# : int */ {
        if (is_string($level) &&
            isset(self::$levels[$level])) {
            return self::$levels[$level];
        }

        throw new Exception\InvalidArgumentException(
            Message::get(
                Message::INVALID_LOG_LEVEL,
                (string) $level
            ),
            Message::INVALID_LOG_LEVEL
        );
    }