Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Document verbosity levels #2408

Closed
wants to merge 1 commit into from

4 participants

@tvlooy

Document verbosity levels

Note that this info is outdated when symfony/symfony#6066 gets merged.

Q A
Doc fix? no
New docs? yes
Applies to all
Fixed tickets #1572
components/console/introduction.rst
((10 lines not shown))
+Option Value
+================================== ===============================
+OutputInterface::VERBOSITY_QUIET Do not output any messages
+OutputInterface::VERBOSITY_NORMAL The default verbosity level
+OutputInterface::VERBOSITY_VERBOSE Increased verbosity of 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
+level of verbosity.
+
+It is possible to print messages in a command only for the according verbosity
+level. For example::
+
+ if (OutputInterface::VERBOSITY_VERBOSE === $output->getVerbosity()) {
+ $output->writeln(/* ... */);
@WouterJ Collaborator
WouterJ added a note

this should be $output->writeln(...);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@Sgoettschkes Sgoettschkes commented on the diff
components/console/introduction.rst
@@ -160,6 +160,31 @@ You can also set these colors and options inside the tagname::
// bold text on a yellow background
$output->writeln('<bg=yellow;options=bold>foo</bg=yellow;options=bold>');
+Verbosity levels
+~~~~~~~~~~~~~~~~
+
+The console has 3 levels of verbosity:
+
+================================== ===============================
+Option Value
+================================== ===============================
+OutputInterface::VERBOSITY_QUIET Do not output any messages
+OutputInterface::VERBOSITY_NORMAL The default verbosity level
+OutputInterface::VERBOSITY_VERBOSE Increased verbosity of messages

Could you use an api link here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@weaverryan
Collaborator

Hey Tom!

This is excellent - nice work! I've patched it into the 2.0 branch at sha: f0dd5d9

Thanks so much!

@weaverryan weaverryan closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 31, 2013
  1. @tvlooy

    Document verbosity levels

    tvlooy authored
This page is out of date. Refresh to see the latest.
Showing with 26 additions and 0 deletions.
  1. +26 −0 components/console/introduction.rst
View
26 components/console/introduction.rst
@@ -160,6 +160,32 @@ You can also set these colors and options inside the tagname::
// bold text on a yellow background
$output->writeln('<bg=yellow;options=bold>foo</bg=yellow;options=bold>');
+Verbosity levels
+~~~~~~~~~~~~~~~~
+
+The console has 3 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

Could you use an api link here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+================================== ===============================
+
+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
+level of verbosity.
+
+It is possible to print messages in a command only for the according verbosity
+level. For example::
+
+ if (OutputInterface::VERBOSITY_VERBOSE === $output->getVerbosity()) {
+ $output->writeln(...);
+ }
+
+Note that when the quiet level is used, all output is suppressed.
Using Command Arguments
-----------------------
Something went wrong with that request. Please try again.