Skip to content

Commit dd75105

Browse files
mweibelMichael Weibel
authored andcommitted
Allow to override VERBOSITY_QUIET in configuration
VERBOSITY_QUIET is set to ERROR by default and you can't override that, even though the OutputInterface allows to use this verbosity. In the default configuration, quiet doesn't mean really quiet as errors are still logged.
1 parent ebce76a commit dd75105

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

DependencyInjection/Configuration.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ public function getConfigTreeBuilder()
528528
->ifArray()
529529
->then(function ($v) {
530530
$map = array();
531-
$verbosities = array('VERBOSITY_NORMAL', 'VERBOSITY_VERBOSE', 'VERBOSITY_VERY_VERBOSE', 'VERBOSITY_DEBUG');
531+
$verbosities = array('VERBOSITY_QUIET', 'VERBOSITY_NORMAL', 'VERBOSITY_VERBOSE', 'VERBOSITY_VERY_VERBOSE', 'VERBOSITY_DEBUG');
532532
// allow numeric indexed array with ascendning verbosity and lowercase names of the constants
533533
foreach ($v as $verbosity => $level) {
534534
if (is_int($verbosity) && isset($verbosities[$verbosity])) {
@@ -542,6 +542,7 @@ public function getConfigTreeBuilder()
542542
})
543543
->end()
544544
->children()
545+
->scalarNode('VERBOSITY_QUIET')->defaultValue('ERROR')->end()
545546
->scalarNode('VERBOSITY_NORMAL')->defaultValue('WARNING')->end()
546547
->scalarNode('VERBOSITY_VERBOSE')->defaultValue('NOTICE')->end()
547548
->scalarNode('VERBOSITY_VERY_VERBOSE')->defaultValue('INFO')->end()

Tests/DependencyInjection/ConfigurationTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ public function testWithConsoleHandler()
267267
OutputInterface::VERBOSITY_NORMAL => Logger::NOTICE,
268268
OutputInterface::VERBOSITY_VERBOSE => Logger::INFO,
269269
OutputInterface::VERBOSITY_VERY_VERBOSE => 150,
270+
OutputInterface::VERBOSITY_QUIET => Logger::ERROR,
270271
OutputInterface::VERBOSITY_DEBUG => Logger::DEBUG
271272
), $config['handlers']['console']['verbosity_levels']);
272273
}

0 commit comments

Comments
 (0)