@param int $verbosity

@return int
198696
protected function convertVerbosityLevel(int $verbosity): int
    {
        switch ($verbosity) {
            case static::VERBOSITY_QUIET:
                $result = OutputInterface::VERBOSITY_QUIET;
                break;
            case static::VERBOSITY_NORMAL:
                $result = OutputInterface::VERBOSITY_NORMAL;
                break;
            case static::VERBOSITY_VERBOSE:
                $result = OutputInterface::VERBOSITY_VERBOSE;
                break;
            case static::VERBOSITY_VERY_VERBOSE:
                $result = OutputInterface::VERBOSITY_VERY_VERBOSE;
                break;
            default:
                $result = OutputInterface::VERBOSITY_NORMAL;
                break;
        }

        return $result;
    }
35418
public function error($string, $verbosity = null)
    {
        if ($this->display) {
            parent::error($string, $verbosity);
        }
    }
1312173
def set_root_logger_from_verbosity(verbosity=0):
    
    kwargs = {}
    if verbosity == 1:
        kwargs.update(level=logging.INFO)
    elif verbosity > 1:
        kwargs.update(level=logging.DEBUG)

    set_root_logger(**kwargs)
357836
public function getCurrentRealmsIncrement(): int
    {
        $currentDifficulty = $this->getValue();
        $maximalDifficulty = $this->getMaximal();
        if ($currentDifficulty <= $maximalDifficulty) {
            return 0;
        }
        $additionalDifficulty = $currentDifficulty - $maximalDifficulty;
        $steps = $additionalDifficulty / $this->getDifficultyAddition()->getDifficultyAdditionPerStep();
        $realmsIncrement = $steps * $this->getDifficultyAddition()->getRealmsChangePerAdditionStep();

        return (int)\ceil($realmsIncrement); // even a tiny piece of a higher realm means the lower realm is not able to create that formula
    }
1138727
def verbosity():
    
    ctx = click.get_current_context()
    state = ctx.ensure_object(CommandState)
    return state.verbosity
675403
public function info($string, $verbosity = NULL, array $args = [])
    {
        $message    =   $this->interpolate($string, $args);
        parent::info($message);
    }
1281115
protected function getSymbolKey($name, $value, $verbosity=self::SHORT)
    {
        if ($name == self::DECIMAL_MARK || $name == self::THOUSANDS_SEPARATOR) {
            return "{$this->formatsPrefix}number.$name";
        }
        return "{$this->formatsPrefix}$name.$verbosity.$value";
    }
18994
public function warn($string, $verbosity = null)
    {
        if (!$this->output->getFormatter()->hasStyle('warning')) {
            $style = new OutputFormatterStyle('yellow');

            $this->output->getFormatter()->setStyle('warning', $style);
        }

        $this->output->writeln("<warning>$string</warning>");
    }
15281
public static function getNumberOfColumns(): int
    {
        if (DIRECTORY_SEPARATOR === '\\') {
            $columns = 80;

            if (preg_match('/^(\d+)x\d+ \(\d+x(\d+)\)$/', trim(getenv('ANSICON')), $matches)) {
                $columns = $matches[1];
            } elseif (function_exists('proc_open')) {
                $process = proc_open(
                    'mode CON',
                    [
                        1 => ['pipe', 'w'],
                        2 => ['pipe', 'w'],
                    ],
                    $pipes,
                    null,
                    null,
                    ['suppress_errors' => true]
                );

                if (is_resource($process)) {
                    $info = stream_get_contents($pipes[1]);
                    fclose($pipes[1]);
                    fclose($pipes[2]);
                    proc_close($process);
                    if (preg_match('/--------+\r?\n.+?(\d+)\r?\n.+?(\d+)\r?\n/', $info, $matches)) {
                        $columns = $matches[2];
                    }
                }
            }

            return $columns - 1;
        }

        if (!self::isInteractive(self::STDIN)) {
            return 80;
        }

        if (preg_match('#\d+ (\d+)#', shell_exec('stty size'), $match) === 1) {
            if ((int)$match[1] > 0) {
                return (int)$match[1];
            }
        }

        if (preg_match('#columns = (\d+);#', shell_exec('stty'), $match) === 1) {
            if ((int)$match[1] > 0) {
                return (int)$match[1];
            }
        }

        return 80;
    }
208315
public function logVerbose()
  {
    if ($this->getVerbosity()>=OutputInterface::VERBOSITY_VERBOSE)
    {
      $args   = func_get_args();
      $format = array_shift($args);

      $this->writeln(vsprintf('<info>'.$format.'</info>', $args));
    }
  }
993082
public function int()
    {
        return $this->markErrorIf(!is_numeric($this->value) || strval(intval($this->value)) != strval($this->value) );
    }
897295
public function getFormat($name, $verbosity = self::SHORT)
    {

        $key = $this->getFormatKey($name, $verbosity);

        if (!isset($this->formatCache[$key])) {
            $this->formatCache[$key] = $this->loadFormat($key);
        }

        return $this->formatCache[$key];

    }
1107206
public function setLogger(Logger $logger, $verbosity = 0, $paranoid = true)
    {
        $this->logger = $logger;
        if ($paranoid) {
            register_shutdown_function(array($this, 'endOfScript'));
        }
        set_error_handler(array($this, 'errorHandler'));
        set_exception_handler(array($this, 'exceptionHandler'));

        if ($verbosity == OutputInterface::VERBOSITY_VERBOSE) {
            $logger->pushHandler(
                new StreamHandler(fopen('php://stdout', 'w'), Logger::DEBUG, false)
            );
            $logger->pushProcessor(new MemoryUsageProcessor);
            $logger->pushProcessor(new MemoryPeakUsageProcessor);
        }
        if ($verbosity == OutputInterface::VERBOSITY_NORMAL) {
            $logger->pushHandler(
                new StreamHandler(fopen('php://stdout', 'w'), Logger::INFO, false)
            );
        }
        $logger->pushHandler(new StreamHandler(fopen('php://stderr', 'w'), Logger::WARNING));
    }
1347866
public function date($date, $verbosity = self::SHORT)
    {
        return $this->toDateTime($date)->format($this->get('date')[$verbosity]);
    }
359299
def get_logger(verbosity):
    
    logger = logging.getLogger(__name__)
    logger.setLevel({
        0: DEFAULT_LOGGING_LEVEL,
        1: logging.INFO,
        2: logging.DEBUG
    }.get(min(2, verbosity), DEFAULT_LOGGING_LEVEL))
    logger.handlers = []
    handler = logging.StreamHandler(sys.stdout)
    handler.setLevel(logging.DEBUG)
    handler.setFormatter(logging.Formatter('%(name)s - %(levelname)s - %(message)s'))
    logger.addHandler(handler)
    return logger
1008728
public function getNumberOfMethodCalls($className, $methodName)
    {
        if (isset($this->methodCalls[$className][$methodName])) {
            return $this->methodCalls[$className][$methodName];
        }

        return 0;
    }
453000
public function count(): int
    {
        // If the count is already set, return it
        if(!is_null($this->count)) {
            return $this->count;
        }

        // Maually create a count by looping through the entities. This will
        // trigger the pagination calls to get the correct count of entities
        $count = 0;
        foreach($this as $entity) {
            $count++;
        }

        $this->count = $count;
        return $count;
    }