From 91477403b3f7040e3c8c3380bac7320268111246 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Thu, 25 Apr 2013 13:45:15 +0200 Subject: [PATCH 1/3] Add note about the additional verbosity flags --- components/console/usage.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/components/console/usage.rst b/components/console/usage.rst index ac7f0b8a2c1..1a73c276ab5 100755 --- a/components/console/usage.rst +++ b/components/console/usage.rst @@ -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'); From bb48899570afbabbacd7091831a2127293267703 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Thu, 25 Apr 2013 16:49:05 +0200 Subject: [PATCH 2/3] Update verbosity docs --- components/console/introduction.rst | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/components/console/introduction.rst b/components/console/introduction.rst index d332b326835..637a4c0bbf5 100755 --- a/components/console/introduction.rst +++ b/components/console/introduction.rst @@ -163,16 +163,18 @@ 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 +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 +======================================= ================================== 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 @@ -181,12 +183,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(...); } From 337707f1a1e263b93ec1d01dd9fafedb5bd13938 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Sat, 27 Apr 2013 17:07:31 +0200 Subject: [PATCH 3/3] Add versionadded --- components/console/introduction.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/console/introduction.rst b/components/console/introduction.rst index 637a4c0bbf5..776bf749c41 100755 --- a/components/console/introduction.rst +++ b/components/console/introduction.rst @@ -163,6 +163,10 @@ You can also set these colors and options inside the tagname:: Verbosity Levels ~~~~~~~~~~~~~~~~ +.. 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`: