src/FilterLogger.php
public function setLevel($level)
    {
        if (!array_key_exists($level, self::LEVEL_PRIORITIES)) {
            throw new Exception(self::ERR_INVALID_LEVEL);
        }

        $lowestPriority = self::LEVEL_PRIORITIES[$level];
        $accepted = [];

        foreach (self::LEVEL_PRIORITIES as $level => $priority) {
            if ($priority > $lowestPriority) {
                continue;
            }

            $accepted[] = $level;
        }

        $this->acceptedLevels = $accepted;
    }
public function setLevel($level)
    {
        if (!array_key_exists($level, self::LEVEL_PRIORITIES)) {
            throw new Exception(self::ERR_INVALID_LEVEL);
        }

        $lowestPriority = self::LEVEL_PRIORITIES[$level];
        $accepted = [];

        foreach (self::LEVEL_PRIORITIES as $level => $priority) {
            if ($priority > $lowestPriority) {
                continue;
            }

            $accepted[] = $level;
        }

        $this->acceptedLevels = $accepted;
    }
public function setLevel ( $ level ) { if ( ! array_key_exists ( $ level , self :: LEVEL_PRIORITIES ) ) { throw new Exception ( self :: ERR_INVALID_LEVEL ) ; } $ lowestPriority = self :: LEVEL_PRIORITIES [ $ level ] ; $ accepted = [ ] ; foreach ( self :: LEVEL_PRIORITIES as $ level => $ priority ) { if ( $ priority > $ lowestPriority ) { continue ; } $ accepted [ ] = $ level ; } $ this -> acceptedLevels = $ accepted ; }
Set the lowest priority log level.

When setting this value, ensure it is a valid level as defined in `Psr\Log\LogLevel`.

@param string $level

@throws Exception

@return void
Set the lowest priority log level .