File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -16,19 +16,18 @@ is passed when a command gets executed.
1616
1717When a lot of logging has to happen, it's cumbersome to print information
1818depending on the verbosity settings (``-v ``, ``-vv ``, ``-vvv ``) because the
19- calls need to be wrapped in conditions. The code quickly gets verbose or dirty.
20- For example::
19+ calls need to be wrapped in conditions. For example::
2120
2221 use Symfony\Component\Console\Input\InputInterface;
2322 use Symfony\Component\Console\Output\OutputInterface;
2423
2524 protected function execute(InputInterface $input, OutputInterface $output)
2625 {
27- if ($output->getVerbosity() >= OutputInterface::VERBOSITY_DEBUG ) {
26+ if ($output->isDebug() ) {
2827 $output->writeln('Some info');
2928 }
3029
31- if ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE ) {
30+ if ($output->isVerbose() ) {
3231 $output->writeln('Some more info');
3332 }
3433 }
You can’t perform that action at this time.
0 commit comments