Correction respect des sauts de lignes dans les loggers

master 3.4.2
Julien Rosset 2 years ago
parent f641fb26eb
commit a55725f19d

@ -71,8 +71,6 @@ class OutputWithLogger extends OutputWrapper {
* @param int $options A bitmask of options * @param int $options A bitmask of options
* *
* @return void * @return void
*
* @noinspection PhpUnusedParameterInspection
*/ */
protected function writeToLogger (iterable|string $messages, bool $newline = false, int $options = 0): void { protected function writeToLogger (iterable|string $messages, bool $newline = false, int $options = 0): void {
if ($this->logger === null || ($options & static::OPTION_SKIP_LOGGER) === static::OPTION_SKIP_LOGGER) { if ($this->logger === null || ($options & static::OPTION_SKIP_LOGGER) === static::OPTION_SKIP_LOGGER) {
@ -94,7 +92,7 @@ class OutputWithLogger extends OutputWrapper {
$messages = [$messages]; $messages = [$messages];
} }
foreach ($messages as $message) { foreach ($messages as $message) {
$this->getLogger()->log($loggerLevel, strip_tags($message)); $this->getLogger()->log($loggerLevel, strip_tags($message) . ($newline ? PHP_EOL : ''));
} }
} }
/** /**

Loading…
Cancel
Save