setVerbosity() public method

Sets the verbosity 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 passed through.
コード例 #1
0
ファイル: IOOutputTest.php プロジェクト: webmozart/console
 public function testGetVerbosityDebug()
 {
     $input = new Input(new StringInputStream());
     $output = new Output(new BufferedOutputStream());
     $errorOutput = new Output(new BufferedOutputStream());
     $this->io = new IO($input, $output, $errorOutput);
     $this->output = new IOOutput($this->io);
     $this->io->setQuiet(false);
     $this->io->setVerbosity(IO::DEBUG);
     $this->assertSame(OutputInterface::VERBOSITY_DEBUG, $this->output->getVerbosity());
 }
コード例 #2
0
ファイル: IOOutput.php プロジェクト: webmozart/console
 /**
  * {@inheritdoc}
  */
 public function setVerbosity($level)
 {
     switch ($level) {
         case self::VERBOSITY_QUIET:
             $this->io->setQuiet(true);
             break;
         case self::VERBOSITY_NORMAL:
             $this->io->setQuiet(false);
             $this->io->setVerbosity(IO::NORMAL);
             break;
         case self::VERBOSITY_VERBOSE:
             $this->io->setQuiet(false);
             $this->io->setVerbosity(IO::VERBOSE);
             break;
         case self::VERBOSITY_VERY_VERBOSE:
             $this->io->setQuiet(false);
             $this->io->setVerbosity(IO::VERY_VERBOSE);
             break;
         case self::VERBOSITY_DEBUG:
             $this->io->setQuiet(false);
             $this->io->setVerbosity(IO::DEBUG);
             break;
     }
 }