Skip to content

Commit ad3dbba

Browse files
committed
feature #6690 Added an example for a different method of verbosity level usage. (smatyas)
This PR was submitted for the 2.7 branch but it was merged into the 2.8 branch instead (closes #6690). Discussion ---------- Added an example for a different method of verbosity level usage. Setting a message level like in the added example, was not yet documented. I just found out this method by looking into the code. I also tested with some dummy command that it really does what I thought: ``` protected function execute(InputInterface $input, OutputInterface $output) { $output->writeln('quiet', OutputInterface::VERBOSITY_QUIET); $output->writeln('normal', OutputInterface::VERBOSITY_NORMAL); $output->writeln('verbose', OutputInterface::VERBOSITY_VERBOSE); $output->writeln('very verbose', OutputInterface::VERBOSITY_VERY_VERBOSE); $output->writeln('debug', OutputInterface::VERBOSITY_DEBUG); } ``` Commits ------- cedfdc4 Added an example for a different method of verbosity level usage.
2 parents 7dfa573 + cedfdc4 commit ad3dbba

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

components/console/introduction.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,9 @@ level. For example::
229229
$output->writeln(...);
230230
}
231231

232+
// alternatively you can pass the verbosity level to writeln()
233+
$output->writeln('...', OutputInterface::VERBOSITY_VERBOSE);
234+
232235
There are also more semantic methods you can use to test for each of the
233236
verbosity levels::
234237

0 commit comments

Comments
 (0)