From e0157674411be63b2425d5eb00bd568cc3793249 Mon Sep 17 00:00:00 2001 From: Edie Lemoine Date: Thu, 10 Oct 2024 14:37:01 +0200 Subject: [PATCH] fix(logging): update log format --- src/Pdk/Logger/PsLogger.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Pdk/Logger/PsLogger.php b/src/Pdk/Logger/PsLogger.php index ac307cec..6d4b02ed 100644 --- a/src/Pdk/Logger/PsLogger.php +++ b/src/Pdk/Logger/PsLogger.php @@ -54,13 +54,14 @@ public function __construct(FileSystemInterface $fileSystem) * @param array $context * * @return void + * @noinspection JsonEncodingApiUsageInspection */ public function log($level, $message, array $context = []): void { $logger = $this->getLogger($level); $fullMessage = empty($context) ? $message - : sprintf("%s\n%s", $message, json_encode(Utils::filterNull($context), JSON_PRETTY_PRINT)); + : sprintf('%s %s', $message, json_encode(Utils::filterNull($context))); $logger->log($fullMessage, $this->mapLevel($level)); }