original_string: public function turn($toggle)
      {
          if(preg_match_all('/^(on|off) (all)?\s?(debug|info|notice|warn|error|critical|alert|emergency)$/', $toggle, $matches)) {
              $flag = $matches[1][0];
              $all = $matches[2][0];
              $name = $matches[3][0];
              $this->sieve->toggle($flag, $name);
              if($all === 'all') {
                  self::$SIEVE->toggle($flag, $name);
              }
          } else {
              throw new \InvalidArgumentException("Invalid format: $toggle");
          }
      }
code: public function turn($toggle)
      {
          if(preg_match_all('/^(on|off) (all)?\s?(debug|info|notice|warn|error|critical|alert|emergency)$/', $toggle, $matches)) {
              $flag = $matches[1][0];
              $all = $matches[2][0];
              $name = $matches[3][0];
              $this->sieve->toggle($flag, $name);
              if($all === 'all') {
                  self::$SIEVE->toggle($flag, $name);
              }
          } else {
              throw new \InvalidArgumentException("Invalid format: $toggle");
          }
      }
code_tokens: public function turn ( $ toggle ) { if ( preg_match_all ( '/^(on|off) (all)?\s?(debug|info|notice|warn|error|critical|alert|emergency)$/' , $ toggle , $ matches ) ) { $ flag = $ matches [ 1 ] [ 0 ] ; $ all = $ matches [ 2 ] [ 0 ] ; $ name = $ matches [ 3 ] [ 0 ] ; $ this -> sieve -> toggle ( $ flag , $ name ) ; if ( $ all === 'all' ) { self :: $ SIEVE -> toggle ( $ flag , $ name ) ; } } else { throw new \ InvalidArgumentException ( "Invalid format: $toggle" ) ; } }
docstring: Sets logging state of the given severity level in a readable format
  
  @example $log->turn('on debug');
  @example $log->turn('off all warn');
  
  @param string $toggle format: (on|off) [all] (debug|info|notice|warn|error|critical|alert|emergency)
docstring_tokens: Sets logging state of the given severity level in a readable format