Skip to content

Commit 7525ab1

Browse files
committed
ConsoleLogger bugfix
Previously, ConsoleLogger would always output everything to its backing output at the default verbosity (VERBOSITY_NORMAL), which meant that if the output had its verbosity setting set to VERBOSITY_QUIET, nothing would ever be output to it, even if the ConsoleLogger's verbosityMap specified that some logging levels should be output even to a VERBOSITY_QUIET output.
1 parent 37c9bc9 commit 7525ab1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Symfony/Component/Console/Logger/ConsoleLogger.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,10 @@ public function log($level, $message, array $context = array())
8888
$output = $this->output;
8989
}
9090

91+
//the if condition check isn't necessary -- it's the same one that $output will do internally anyway.
92+
// We only do it for efficiency here as the message formatting is relatively expensive.
9193
if ($output->getVerbosity() >= $this->verbosityLevelMap[$level]) {
92-
$output->writeln(sprintf('<%1$s>[%2$s] %3$s</%1$s>', $this->formatLevelMap[$level], $level, $this->interpolate($message, $context)));
94+
$output->writeln(sprintf('<%1$s>[%2$s] %3$s</%1$s>', $this->formatLevelMap[$level], $level, $this->interpolate($message, $context)), $this->verbosityLevelMap[$level]);
9395
}
9496
}
9597

0 commit comments

Comments
 (0)