Cake\Console\ConsoleIo::level PHP Method

level() public method

Get/set the current output level.
public level ( null | integer $level = null ) : integer
$level null | integer The current output level.
return integer The current output level.
    public function level($level = null)
    {
        if ($level !== null) {
            $this->_level = $level;
        }
        return $this->_level;
    }

Usage Example

Example #1
0
 /**
  * Set the output level based on the parameters.
  *
  * This reconfigures both the output level for out()
  * and the configured stdout/stderr logging
  *
  * @return void
  */
 protected function _setOutputLevel()
 {
     $this->_io->setLoggers(ConsoleIo::NORMAL);
     if (!empty($this->params['quiet'])) {
         $this->_io->level(ConsoleIo::QUIET);
         $this->_io->setLoggers(ConsoleIo::QUIET);
     }
     if (!empty($this->params['verbose'])) {
         $this->_io->level(ConsoleIo::VERBOSE);
         $this->_io->setLoggers(ConsoleIo::VERBOSE);
     }
 }
All Usage Examples Of Cake\Console\ConsoleIo::level