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
16553
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;
    }
1015371
public function withLevel($level)
    {
        if (!isset(self::$levels[$level])) {
            throw new InvalidArgumentException('Unsupported log level "' . $level . '"');
        }

        $this->level = $level;
    }
960818
public function log($message, $level = LogLevel::DEBUG)
    {
        $this->runtime->log($message, $level);
    }
978146
public function setNestingLevel($level = null)
	{
		if (func_num_args() and is_numeric($level) and $level > 0)
		{
			$this->maxNestingLevel = $level;
		}

		return $this->maxNestingLevel;
	}
985506
public function setLevel($level)
    {
        if (!isset(self::$levels[$level])) {
            throw new \InvalidArgumentException('Invalid log level');
        }
        $this->level = $level;
    }
1312554
public static void setLoggingLevel(final Level level) {
    final Handler[] handlers = Logger.getLogger("").getHandlers();
    ConsoleHandler ch = null;
    for (final Handler h : handlers) {
      if (h instanceof ConsoleHandler) {
        ch = (ConsoleHandler) h;
        break;
      }
    }
    if (ch == null) {
      ch = new ConsoleHandler();
      Logger.getLogger("").addHandler(ch);
    }
    ch.setLevel(level);
    Logger.getLogger("").setLevel(level);
  }
283621
final public function setLevel($level)
    {
        if (!in_array(strtolower($level), $this->getAllowedLevel())) {
            throw new InvalidArgumentException();
        }

        $this->level = $level;

        return $this;
    }
813806
protected function sysLog($msg, $level)
    {
        switch ($level) {
            case self::EMERG:
                $priority = LOG_EMERG;
                break;
            case self::ERROR:
                $priority = LOG_ERR;
                break;
            case self::WARN:
                $priority = LOG_WARNING;
                break;
            case self::DEBUG:
                $priority = LOG_DEBUG;
                break;
            case self::INFO:
            case self::PROC_INFO:
            case self::WORKER_INFO:
            default:
                $priority = LOG_INFO;
                break;
        }

        if (!$ret = syslog($priority, $msg)) {
            $this->stderr("Unable to write to syslog\n");
        }

        return $ret;
    }
334636
protected function logException(\Exception $exception): void
    {
        if (!$this->logger) {
            return;
        }

        $message = sprintf(
            'Exception thrown when handling an exception (%s: %s at %s line %s)',
            get_class($exception),
            $exception->getMessage(),
            $exception->getFile(),
            $exception->getLine()
        );

        $this->logger->log($this->level, $message, [
            'exception' => $exception,
        ]);
    }
605798
protected function setLevel( int$level ):self
	{
		$level-= $this->level;

		if( $level<=0 ){
			$this->closeNodes(-$level);
		}elseif( $level==1 ){
			$this->level+= 1;
		}else{
			$this->throw('Indent error.');
		}

		return $this;
	}
577495
public void setLevel(String logger, Level level) {
      Logger log = getLogger(logger);
      log.setLevel(level);
      for (String loggerName : getLoggerNames()) {
         if (loggerName.startsWith(logger) && !loggerName.equals(logger)) {
            getLogger(loggerName).setLevel(level);
         }
      }
   }
728780
protected function log($message, $level = Logger::INFO)
    {
        $this->logger->log($message, $level);
    }
242509
def set_loglevel(self, level):
        
        self.log_level = level
        log_manager.config_stdio(default_level=level)
922814
public function setEnabledLevels(array $levels)
    {
        $enabledLevels = array();

        foreach ($levels as $value) {
            if ($this->validLevel($value)) {
                array_push($enabledLevels, $value);
            }
        }

        $this->_enabledLevels = $enabledLevels;
    }
904914
protected function logMessage($level, $message)
    {
        if (array_search($level, $this->levels) > $this->levelPosition) {
            return;
        }

        echo $message;
    }
100974
public function setLevel(string $level)
    {
        if (!defined(LogLevel::class . '::' . strtoupper($level)))
            throw new \DomainException("Invalid log level: $level");

        $this->level = $level;
        $this->level_num = self::$LEVEL_NUMERIC[$level];
        return $this;
    }
717454
public function setLevel(\n2n\log4php\LoggerLevel $level = null) {
		if (isset($level)) {
			parent::setLevel($level);
		} else {
			throw new \n2n\log4php\LoggerException("log4php: Cannot set LoggerRoot level to null.", E_USER_WARNING);
		}
	}