Skip to content

Commit

Permalink
quieter output
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe Green committed Jun 2, 2016
1 parent 18646ff commit 6831c12
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Binary file modified db-sync.phar
Binary file not shown.
6 changes: 5 additions & 1 deletion src/Command/SyncCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.')
;
}

Expand Down Expand Up @@ -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;

Expand Down
4 changes: 3 additions & 1 deletion src/DbSync.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}

Expand Down

0 comments on commit 6831c12

Please sign in to comment.