Skip to content

Commit 0f745f4

Browse files
committed
Merge pull request symfony#2554 from Seldaek/verbosityflags
Add note about the additional verbosity flags
2 parents bf1e064 + 337707f commit 0f745f4

File tree

2 files changed

+24
-10
lines changed

2 files changed

+24
-10
lines changed

components/console/introduction.rst

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -163,16 +163,22 @@ You can also set these colors and options inside the tagname::
163163
Verbosity Levels
164164
~~~~~~~~~~~~~~~~
165165

166-
The console has 3 levels of verbosity. These are defined in the
166+
.. versionadded:: 2.3
167+
The ``VERBOSITY_VERY_VERBOSE`` and ``VERBOSITY_DEBUG`` constants were introduced
168+
in version 2.3
169+
170+
The console has 5 levels of verbosity. These are defined in the
167171
:class:`Symfony\\Component\\Console\\Output\\OutputInterface`:
168172

169-
================================== ===============================
170-
Option Value
171-
================================== ===============================
172-
OutputInterface::VERBOSITY_QUIET Do not output any messages
173-
OutputInterface::VERBOSITY_NORMAL The default verbosity level
174-
OutputInterface::VERBOSITY_VERBOSE Increased verbosity of messages
175-
================================== ===============================
173+
======================================= ==================================
174+
Option Value
175+
======================================= ==================================
176+
OutputInterface::VERBOSITY_QUIET Do not output any messages
177+
OutputInterface::VERBOSITY_NORMAL The default verbosity level
178+
OutputInterface::VERBOSITY_VERBOSE Increased verbosity of messages
179+
OutputInterface::VERBOSITY_VERY_VERBOSE Informative non essential messages
180+
OutputInterface::VERBOSITY_DEBUG Debug messages
181+
======================================= ==================================
176182

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

183189
The full exception stacktrace is printed if the ``VERBOSITY_VERBOSE``
184-
level is used.
190+
level or above is used.
185191

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

189-
if (OutputInterface::VERBOSITY_VERBOSE === $output->getVerbosity()) {
195+
if (OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
190196
$output->writeln(...);
191197
}
192198

components/console/usage.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,14 @@ with:
7777
$ php app/console list --verbose
7878
$ php app/console list -v
7979
80+
The verbose flag can optionally take a value between 1 (default) and 3 to
81+
output even more verbose messages:
82+
83+
$ php app/console list --verbose=2
84+
$ php app/console list -vv
85+
$ php app/console list --verbose=3
86+
$ php app/console list -vvv
87+
8088
If you set the optional arguments to give your application a name and version::
8189

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

0 commit comments

Comments
 (0)