Skip to content

Commit 36f8174

Browse files
committed
Don't use OutputInterface::VERBOSITY constants, use PHP methods instead
1 parent c60a234 commit 36f8174

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

logging/monolog_console.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,18 @@ is passed when a command gets executed.
1616

1717
When a lot of logging has to happen, it's cumbersome to print information
1818
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::
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
}

0 commit comments

Comments
 (0)