Merge pull request #10948 from annando/logger-json

Improve the JSON output of the log entries
This commit is contained in:
Hypolite Petovan 2021-11-02 16:04:40 -04:00 committed by GitHub
commit 72a500ea08
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -129,7 +129,7 @@ abstract class AbstractLogger implements LoggerInterface
} }
} }
return @json_encode($output); return @json_encode($output, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
} }
/** /**

View file

@ -157,7 +157,7 @@ abstract class AbstractLoggerTest extends MockedTest
self::assertLogline($text); self::assertLogline($text);
self::assertStringContainsString(@json_encode($context), $text); self::assertStringContainsString(@json_encode($context, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), $text);
} }
/** /**
@ -176,7 +176,7 @@ abstract class AbstractLoggerTest extends MockedTest
self::assertLogline($text); self::assertLogline($text);
self::assertStringContainsString(@json_encode($assertion), $this->getContent()); self::assertStringContainsString(@json_encode($assertion, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), $this->getContent());
} }
public function testNoObjectHandling() public function testNoObjectHandling()