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.
16
16
17
17
When a lot of logging has to happen, it's cumbersome to print information
18
18
depending 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::
21
20
22
21
use Symfony\Component\Console\Input\InputInterface;
23
22
use Symfony\Component\Console\Output\OutputInterface;
24
23
25
24
protected function execute(InputInterface $input, OutputInterface $output)
26
25
{
27
- if ($output->getVerbosity() >= OutputInterface::VERBOSITY_DEBUG ) {
26
+ if ($output->isDebug() ) {
28
27
$output->writeln('Some info');
29
28
}
30
29
31
- if ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE ) {
30
+ if ($output->isVerbose() ) {
32
31
$output->writeln('Some more info');
33
32
}
34
33
}
You can’t perform that action at this time.
0 commit comments