diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index 7dea0247..31ab8010 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -1047,19 +1047,6 @@ private function addVerbosityLevelSection(ArrayNodeDefinition $handerNode) )); } - try { - if (Logger::API === 3) { - $level = Logger::toMonologLevel($level)->value; - } else { - $level = Logger::toMonologLevel(is_numeric($level) ? (int) $level : $level); - } - } catch (\Psr\Log\InvalidArgumentException $e) { - throw new InvalidConfigurationException(sprintf( - 'The configured minimum log level "%s" for verbosity "%s" is invalid as it is not defined in Monolog\Logger.', - $level, $verbosity - )); - } - $map[constant($verbosityConstant)] = $level; } diff --git a/Tests/DependencyInjection/ConfigurationTest.php b/Tests/DependencyInjection/ConfigurationTest.php index 38847364..7f76cd75 100644 --- a/Tests/DependencyInjection/ConfigurationTest.php +++ b/Tests/DependencyInjection/ConfigurationTest.php @@ -278,7 +278,7 @@ public function testWithConsoleHandler() 'verbosity_levels' => [ 'VERBOSITY_NORMAL' => 'NOTICE', 'verbosity_verbose' => 'info', - 'VERBOSITY_very_VERBOSE' => '200' + 'VERBOSITY_very_VERBOSE' => '200', ] ] ] @@ -289,11 +289,11 @@ public function testWithConsoleHandler() $this->assertSame('console', $config['handlers']['console']['type']); $this->assertSame([ - OutputInterface::VERBOSITY_NORMAL => Logger::NOTICE, - OutputInterface::VERBOSITY_VERBOSE => Logger::INFO, - OutputInterface::VERBOSITY_VERY_VERBOSE => 200, - OutputInterface::VERBOSITY_QUIET => Logger::ERROR, - OutputInterface::VERBOSITY_DEBUG => Logger::DEBUG + OutputInterface::VERBOSITY_NORMAL => 'NOTICE', + OutputInterface::VERBOSITY_VERBOSE => 'INFO', + OutputInterface::VERBOSITY_VERY_VERBOSE => '200', + OutputInterface::VERBOSITY_QUIET => 'ERROR', + OutputInterface::VERBOSITY_DEBUG => 'DEBUG', ], $config['handlers']['console']['verbosity_levels']); }