protected function getBufferedOutput(OutputInterface $output, $verbosity = null)
    {
        $buffer = new BufferedOutput();
        $buffer->setDecorated($output->isDecorated());
        $buffer->setFormatter($output->getFormatter());
        if ($verbosity === null) {
            $buffer->setVerbosity($output->getVerbosity());
        } else {
            $buffer->setVerbosity($verbosity);
        }

        return $buffer;
    }