Skip to content

Commit 6831c12

Browse files
author
Joe Green
committed
quieter output
1 parent 18646ff commit 6831c12

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

db-sync.phar

124 KB
Binary file not shown.

src/Command/SyncCommand.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ protected function configure()
6565
->addOption('target.table',null , InputOption::VALUE_REQUIRED, 'The name of the table on the target host if different to the source.')
6666
->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.')
6767
->addOption('where', null , InputOption::VALUE_REQUIRED, 'A where clause to apply to the tables.')
68+
->addOption('verbose', 'v' , InputOption::VALUE_NONE, 'Enable verbose output.')
6869
;
6970
}
7071

@@ -93,7 +94,10 @@ protected function execute(InputInterface $input, OutputInterface $output)
9394
{
9495
$this->output = $output;
9596

96-
$this->output->setVerbosity(OutputInterface::VERBOSITY_DEBUG);
97+
if($input->getOption('verbose'))
98+
{
99+
$this->output->setVerbosity(OutputInterface::VERBOSITY_DEBUG);
100+
}
97101

98102
$this->input = $input;
99103

src/DbSync.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ private function doComparison(Table $source, Table $destination, $syncColumns, $
123123
{
124124
$result->addRowsChecked($blockSize);
125125

126-
$this->logger->info("Written '{$result->getRowsAffected()}' rows, checked '{$result->getRowsChecked()}' rows for tables '$source' => '$destination'");
126+
$this->logger->debug("Written '{$result->getRowsAffected()}' rows, checked '{$result->getRowsChecked()}' rows for tables '$source' => '$destination'");
127127
}
128128

129129
$index = $nextIndex;
@@ -135,6 +135,8 @@ private function doComparison(Table $source, Table $destination, $syncColumns, $
135135
}
136136
}
137137

138+
$this->logger->info("Written '{$result->getRowsAffected()}' rows, checked '{$result->getRowsChecked()}' rows for tables '$source' => '$destination'");
139+
138140
return $result;
139141
}
140142

0 commit comments

Comments
 (0)