]> source.dussan.org Git - nextcloud-server.git/commitdiff
Do not decorate the CLI output if it's explicitly turned off 31877/head
authorChristoph Wurst <christoph@winzerhof-wurst.at>
Thu, 7 Apr 2022 12:38:10 +0000 (14:38 +0200)
committerChristoph Wurst <christoph@winzerhof-wurst.at>
Thu, 7 Apr 2022 12:38:10 +0000 (14:38 +0200)
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
lib/private/Console/TimestampFormatter.php

index 59e480b39e8d8227e3aeba097657b6d6f54ec1db..c25ed578805afef16c652e55140b18550eecfab3 100644 (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;