Skip to content

Add note about the additional verbosity flags #2554

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 4, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 16 additions & 10 deletions components/console/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -163,16 +163,22 @@ You can also set these colors and options inside the tagname::
Verbosity Levels
~~~~~~~~~~~~~~~~

The console has 3 levels of verbosity. These are defined in the
.. versionadded:: 2.3
The ``VERBOSITY_VERY_VERBOSE`` and ``VERBOSITY_DEBUG`` constants were introduced
in version 2.3

The console has 5 levels of verbosity. These are defined in the
:class:`Symfony\\Component\\Console\\Output\\OutputInterface`:

================================== ===============================
Option Value
================================== ===============================
OutputInterface::VERBOSITY_QUIET Do not output any messages
OutputInterface::VERBOSITY_NORMAL The default verbosity level
OutputInterface::VERBOSITY_VERBOSE Increased verbosity of messages
================================== ===============================
======================================= ==================================
Option Value
======================================= ==================================
OutputInterface::VERBOSITY_QUIET Do not output any messages
OutputInterface::VERBOSITY_NORMAL The default verbosity level
OutputInterface::VERBOSITY_VERBOSE Increased verbosity of messages
OutputInterface::VERBOSITY_VERY_VERBOSE Informative non essential messages
OutputInterface::VERBOSITY_DEBUG Debug messages
======================================= ==================================
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should add a versionnadded message for new ones

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done (I hope correctly, don't know much about the docs stuff)


You can specify the quiet verbosity level with the ``--quiet`` or ``-q``
option. The ``--verbose`` or ``-v`` option is used when you want an increased
Expand All @@ -181,12 +187,12 @@ level of verbosity.
.. tip::

The full exception stacktrace is printed if the ``VERBOSITY_VERBOSE``
level is used.
level or above is used.

It is possible to print a message in a command for only a specific verbosity
level. For example::

if (OutputInterface::VERBOSITY_VERBOSE === $output->getVerbosity()) {
if (OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
$output->writeln(...);
}

Expand Down
8 changes: 8 additions & 0 deletions components/console/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ with:
$ php app/console list --verbose
$ php app/console list -v

The verbose flag can optionally take a value between 1 (default) and 3 to
output even more verbose messages:

$ php app/console list --verbose=2
$ php app/console list -vv
$ php app/console list --verbose=3
$ php app/console list -vvv

If you set the optional arguments to give your application a name and version::

$application = new Application('Acme Console Application', '1.2');
Expand Down