diff --git a/db-sync.phar b/db-sync.phar index 6132983..9f699c0 100755 Binary files a/db-sync.phar and b/db-sync.phar differ diff --git a/src/Command/SyncCommand.php b/src/Command/SyncCommand.php index 86556fd..41f5669 100644 --- a/src/Command/SyncCommand.php +++ b/src/Command/SyncCommand.php @@ -65,6 +65,7 @@ protected function configure() ->addOption('target.table',null , InputOption::VALUE_REQUIRED, 'The name of the table on the target host if different to the source.') ->addOption('target.password',null , InputOption::VALUE_REQUIRED, 'The password for the target host if the target user is specified. Will be solicited on the tty if not given.') ->addOption('where', null , InputOption::VALUE_REQUIRED, 'A where clause to apply to the tables.') + ->addOption('verbose', 'v' , InputOption::VALUE_NONE, 'Enable verbose output.') ; } @@ -93,7 +94,10 @@ protected function execute(InputInterface $input, OutputInterface $output) { $this->output = $output; - $this->output->setVerbosity(OutputInterface::VERBOSITY_DEBUG); + if($input->getOption('verbose')) + { + $this->output->setVerbosity(OutputInterface::VERBOSITY_DEBUG); + } $this->input = $input; diff --git a/src/DbSync.php b/src/DbSync.php index 6d13414..a974b78 100644 --- a/src/DbSync.php +++ b/src/DbSync.php @@ -123,7 +123,7 @@ private function doComparison(Table $source, Table $destination, $syncColumns, $ { $result->addRowsChecked($blockSize); - $this->logger->info("Written '{$result->getRowsAffected()}' rows, checked '{$result->getRowsChecked()}' rows for tables '$source' => '$destination'"); + $this->logger->debug("Written '{$result->getRowsAffected()}' rows, checked '{$result->getRowsChecked()}' rows for tables '$source' => '$destination'"); } $index = $nextIndex; @@ -135,6 +135,8 @@ private function doComparison(Table $source, Table $destination, $syncColumns, $ } } + $this->logger->info("Written '{$result->getRowsAffected()}' rows, checked '{$result->getRowsChecked()}' rows for tables '$source' => '$destination'"); + return $result; }