@@ -7,7 +7,10 @@ messages, but you can control their verbosity with the ``-q`` and ``-v`` options
7
7
8
8
.. code-block :: terminal
9
9
10
- # do not output any message (not even the command result messages)
10
+ # suppress all output, including errors
11
+ $ php bin/console some-command --silent
12
+
13
+ # suppress all output (even the command result messages) but display errors
11
14
$ php bin/console some-command -q
12
15
$ php bin/console some-command --quiet
13
16
@@ -23,13 +26,18 @@ messages, but you can control their verbosity with the ``-q`` and ``-v`` options
23
26
# display all messages (useful to debug errors)
24
27
$ php bin/console some-command -vvv
25
28
29
+ .. versionadded :: 7.2
30
+
31
+ The ``--silent `` option was introduced in Symfony 7.2.
32
+
26
33
The verbosity level can also be controlled globally for all commands with the
27
34
``SHELL_VERBOSITY `` environment variable (the ``-q `` and ``-v `` options still
28
35
have more precedence over the value of ``SHELL_VERBOSITY ``):
29
36
30
37
===================== ========================= ===========================================
31
38
Console option ``SHELL_VERBOSITY `` value Equivalent PHP constant
32
39
===================== ========================= ===========================================
40
+ ``--silent `` ``-2 `` ``OutputInterface::VERBOSITY_SILENT ``
33
41
``-q `` or ``--quiet `` ``-1 `` ``OutputInterface::VERBOSITY_QUIET ``
34
42
(none) ``0 `` ``OutputInterface::VERBOSITY_NORMAL ``
35
43
``-v `` ``1 `` ``OutputInterface::VERBOSITY_VERBOSE ``
@@ -58,7 +66,7 @@ level. For example::
58
66
'Password: '.$input->getArgument('password'),
59
67
]);
60
68
61
- // available methods: ->isQuiet(), ->isVerbose(), ->isVeryVerbose(), ->isDebug()
69
+ // available methods: ->isSilent(), -> isQuiet(), ->isVerbose(), ->isVeryVerbose(), ->isDebug()
62
70
if ($output->isVerbose()) {
63
71
$output->writeln('User class: '.get_class($user));
64
72
}
@@ -73,10 +81,19 @@ level. For example::
73
81
}
74
82
}
75
83
76
- When the quiet level is used, all output is suppressed as the default
84
+ .. versionadded :: 7.2
85
+
86
+ The ``isSilent() `` method was introduced in Symfony 7.2.
87
+
88
+ When the silent or quiet level are used, all output is suppressed as the default
77
89
:method: `Symfony\\ Component\\ Console\\ Output\\ Output::write ` method returns
78
90
without actually printing.
79
91
92
+ .. tip ::
93
+
94
+ When using the ``silent `` verbosity, errors won't be displayed in the console
95
+ but they will still be logged through the :doc: `Symfony logger </logging >` integration.
96
+
80
97
.. tip ::
81
98
82
99
The MonologBridge provides a :class: `Symfony\\ Bridge\\ Monolog\\ Handler\\ ConsoleHandler `
0 commit comments