Skip to content

Commit

Permalink
Merge pull request #31877 from nextcloud/fix/no-console-formatting-if…
Browse files Browse the repository at this point in the history
…-decoration-off

Do not decorate the CLI output if it's explicitly turned off
  • Loading branch information
come-nc authored Apr 7, 2022
2 parents 018ca43 + 49cb1b7 commit 7bd8a0f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/private/Console/TimestampFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ public function getStyle($name) {
* 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;

Expand Down

0 comments on commit 7bd8a0f

Please sign in to comment.