Webmozart\Console\Api\IO\Output::setVerbosity PHP Method

setVerbosity() public method

Sets the verbosity level of the output.
public setVerbosity ( integer $verbosity )
$verbosity integer One of the constants {@link NORMAL}, {@link VERBOSE}, {@link VERY_VERBOSE} or {@link DEBUG}. Only output with the given verbosity level or smaller will be written out.
    public function setVerbosity($verbosity)
    {
        Assert::oneOf($verbosity, array(IO::NORMAL, IO::VERBOSE, IO::VERY_VERBOSE, IO::DEBUG), 'The verbosity must be one of IO::NORMAL, IO::VERBOSE, IO::VERY_VERBOSE and IO::DEBUG.');
        $this->verbosity = (int) $verbosity;
    }

Usage Example

示例#1
0
 public function testWriteLineRawWhenDebug()
 {
     $this->output->setVerbosity(IO::DEBUG);
     $this->output->writeLineRaw('Lorem ipsum');
     $this->output->writeLineRaw('dolor sit amet', IO::VERBOSE);
     $this->output->writeLineRaw('consetetur', IO::VERY_VERBOSE);
     $this->output->writeLineRaw('sadipscing elitr', IO::DEBUG);
     $this->assertSame('Lorem ipsum' . PHP_EOL . 'dolor sit amet' . PHP_EOL . 'consetetur' . PHP_EOL . 'sadipscing elitr' . PHP_EOL, $this->stream->fetch());
 }
All Usage Examples Of Webmozart\Console\Api\IO\Output::setVerbosity