Skip to content

Commit

Permalink
feature #6690 Added an example for a different method of verbosity le…
Browse files Browse the repository at this point in the history
…vel 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.
  • Loading branch information
xabbuh committed Jun 30, 2016
2 parents 7dfa573 + cedfdc4 commit ad3dbba
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions components/console/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,9 @@ level. For example::
$output->writeln(...);
}

// alternatively you can pass the verbosity level to writeln()
$output->writeln('...', OutputInterface::VERBOSITY_VERBOSE);

There are also more semantic methods you can use to test for each of the
verbosity levels::

Expand Down

0 comments on commit ad3dbba

Please sign in to comment.