Skip to content

Document verbosity levels #2408

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

Closed
wants to merge 1 commit into from
Closed
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: 26 additions & 0 deletions components/console/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you use an api link here?

================================== ===============================

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
-----------------------
Expand Down