From 90c336abae16d1006c6082f024885efeaad704bc Mon Sep 17 00:00:00 2001 From: Ole Date: Mon, 8 Jul 2024 16:30:19 +0200 Subject: [PATCH] fix: add null coalesce to avoid ci errors --- Classes/Backend/JSONConsoleLogger.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Classes/Backend/JSONConsoleLogger.php b/Classes/Backend/JSONConsoleLogger.php index 367e411..05c28b1 100644 --- a/Classes/Backend/JSONConsoleLogger.php +++ b/Classes/Backend/JSONConsoleLogger.php @@ -58,8 +58,8 @@ public function append(string $message, int $severity = LOG_INFO, $additionalDat try { $data = [ 'severity' => $severityLabel, - 'service' => $this->serviceContext['service'], - 'version' => $this->serviceContext['version'], + 'service' => $this->serviceContext['service'] ?? '', + 'version' => $this->serviceContext['version'] ?? '', 'message' => $message, 'additionalData' => $additionalData, 'date' => (new \DateTime('now'))->format('Y-m-d'), @@ -69,8 +69,8 @@ public function append(string $message, int $severity = LOG_INFO, $additionalDat } catch (\Exception $e) { $data = [ 'severity' => $this->severityLabels[LOG_WARNING], - 'service' => $this->serviceContext['service'], - 'version' => $this->serviceContext['version'], + 'service' => $this->serviceContext['service'] ?? '', + 'version' => $this->serviceContext['version'] ?? '', 'message' => 'Could not decode additional data of log message.', 'additionalData' => [ 'previousLog' => [