public function logCommand($command, $duration, $connection, $error = false)
    {
        ++$this->nbCommands;

        if (null !== $this->logger) {
            $this->commands[] = array('cmd' => $command, 'executionMS' => $duration, 'conn' => $connection, 'error' => $error);
            if ($error) {
                $message = 'Command "' . $command . '" failed (' . $error . ')';

                $this->logger->error($message);
            } else {
                $this->logger->debug('Executing command "' . $command . '"');
            }
        }
    }
public function logCommand($command, $duration, $connection, $error = false)
    {
        ++$this->nbCommands;

        if (null !== $this->logger) {
            $this->commands[] = array('cmd' => $command, 'executionMS' => $duration, 'conn' => $connection, 'error' => $error);
            if ($error) {
                $message = 'Command "' . $command . '" failed (' . $error . ')';

                $this->logger->error($message);
            } else {
                $this->logger->debug('Executing command "' . $command . '"');
            }
        }
    }
public function logCommand ( $ command , $ duration , $ connection , $ error = false ) { ++ $ this -> nbCommands ; if ( null !== $ this -> logger ) { $ this -> commands [ ] = array ( 'cmd' => $ command , 'executionMS' => $ duration , 'conn' => $ connection , 'error' => $ error ) ; if ( $ error ) { $ message = 'Command "' . $ command . '" failed (' . $ error . ')' ; $ this -> logger -> error ( $ message ) ; } else { $ this -> logger -> debug ( 'Executing command "' . $ command . '"' ) ; } } }
Logs a command

@param string      $command    Redis command
@param float       $duration   Duration in milliseconds
@param string      $connection Connection alias
@param bool|string $error      Error message or false if command was successful
Logs a command