Do not decorate the CLI output if it's explicitly turned off

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
This commit is contained in:
Christoph Wurst 2022-04-07 14:38:10 +02:00 committed by backportbot[bot]
parent 48e7daea2e
commit 9534931462

View file

@ -99,6 +99,11 @@ class TimestampFormatter implements OutputFormatterInterface {
* log timezone and dateformat, e.g. "2015-06-23T17:24:37+02:00"
*/
public function format($message) {
if (!$this->formatter->isDecorated()) {
// Don't add anything to the output when we shouldn't
return $this->formatter->format($message);
}
$timeZone = $this->config->getSystemValue('logtimezone', 'UTC');
$timeZone = $timeZone !== null ? new \DateTimeZone($timeZone) : null;