public function levelPriority(string $level): int {
        static $priorities = [
            LogLevel::DEBUG     => LOG_DEBUG,
            LogLevel::INFO      => LOG_INFO,
            LogLevel::NOTICE    => LOG_NOTICE,
            LogLevel::WARNING   => LOG_WARNING,
            LogLevel::ERROR     => LOG_ERR,
            LogLevel::CRITICAL  => LOG_CRIT,
            LogLevel::ALERT     => LOG_ALERT,
            LogLevel::EMERGENCY => LOG_EMERG
        ];

        if (isset($priorities[$level])) {
            return $priorities[$level];
        } else {
            return LOG_DEBUG + 1;
        }
    }
public function levelPriority(string $level): int {
        static $priorities = [
            LogLevel::DEBUG     => LOG_DEBUG,
            LogLevel::INFO      => LOG_INFO,
            LogLevel::NOTICE    => LOG_NOTICE,
            LogLevel::WARNING   => LOG_WARNING,
            LogLevel::ERROR     => LOG_ERR,
            LogLevel::CRITICAL  => LOG_CRIT,
            LogLevel::ALERT     => LOG_ALERT,
            LogLevel::EMERGENCY => LOG_EMERG
        ];

        if (isset($priorities[$level])) {
            return $priorities[$level];
        } else {
            return LOG_DEBUG + 1;
        }
    }
public function levelPriority ( string $ level ) : int { static $ priorities = [ LogLevel :: DEBUG => LOG_DEBUG , LogLevel :: INFO => LOG_INFO , LogLevel :: NOTICE => LOG_NOTICE , LogLevel :: WARNING => LOG_WARNING , LogLevel :: ERROR => LOG_ERR , LogLevel :: CRITICAL => LOG_CRIT , LogLevel :: ALERT => LOG_ALERT , LogLevel :: EMERGENCY => LOG_EMERG ] ; if ( isset ( $ priorities [ $ level ] ) ) { return $ priorities [ $ level ] ; } else { return LOG_DEBUG + 1 ; } }
Get the numeric priority for a log level.

The priorities are set to the LOG_* constants from the {@link syslog()} function.
A lower number is more severe.

@param string|int $level The string log level or an actual priority.
@return int Returns the numeric log level or `8` if the level is invalid.
Get the numeric priority for a log level .