/** * {@inheritdoc} */ public function executeCommand(ICommand $command) { if (null === $this->logger) { return $this->connection->executeCommand($command); } $startTime = microtime(true); $result = $this->connection->executeCommand($command); $duration = (microtime(true) - $startTime) * 1000; $error = $result instanceof ResponseError ? (string) $result : false; $this->logger->logCommand((string) $command, $duration, $this->getParameters()->alias, $error); return $result; }