8000 Removes \n or space when / are empty · symfony/symfony@0d8edae · GitHub
[go: up one dir, main page]

Skip to content

Commit 0d8edae

Browse files
kirkmaderafabpot
authored andcommitted
Removes \n or space when / are empty
1 parent ca10f8e commit 0d8edae

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/Symfony/Bridge/Monolog/Formatter/ConsoleFormatter.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,20 @@ public function format(array $record)
117117
$levelColor = self::$levelColorMap[$record['level']];
118118

119119
if ($this->options['multiline']) {
120-
$context = $extra = "\n";
120+
$separator = "\n";
121121
} else {
122-
$context = $extra = ' ';
122+
$separator = ' ';
123+
}
124+
125+
$context = $this->dumpData($record['context']);
126+
if ($context) {
127+
$context = $separator.$context;
128+
}
129+
130+
$extra = $this->dumpData($record['extra']);
131+
if ($extra) {
132+
$extra = $separator.$extra;
123133
}
124-
$context .= $this->dumpData($record['context']);
125-
$extra .= $this->dumpData($record['extra']);
126134

127135
$formatted = strtr($this->options['format'], array(
128136
'%datetime%' => $record['datetime']->format($this->options['date_format']),

0 commit comments

Comments
 (0)
0