From 1e5fced1b00d01643006e82858f10ed737a1166b Mon Sep 17 00:00:00 2001 From: Matias Melograno Date: Tue, 7 Feb 2023 16:17:57 -0300 Subject: [PATCH 1/4] fixed array to string conversion on logs --- CHANGES.txt | 3 +++ src/SplitIO/Component/Log/Logger.php | 3 +++ src/SplitIO/Sdk/Client.php | 1 + src/SplitIO/TreatmentImpression.php | 2 +- src/SplitIO/Version.php | 2 +- tests/Suite/Sdk/SdkReadOnlyTest.php | 2 +- 6 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 70908803..65e17c58 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,6 @@ +7.1.6 (Feb XX, 2023) + - Fixed logging on array conversion. + 7.1.5 (Oct 28, 2022) - Updated phpdocs for `ClientInterface`. diff --git a/src/SplitIO/Component/Log/Logger.php b/src/SplitIO/Component/Log/Logger.php index 25c747cc..d05dddb1 100644 --- a/src/SplitIO/Component/Log/Logger.php +++ b/src/SplitIO/Component/Log/Logger.php @@ -60,6 +60,9 @@ public function __construct(LogHandlerInterface $handler = null, $level = LogLev public function log($level, $message, array $context = array()) { if ($this->logLevels[$level] <= $this->logLevel) { + if (is_array($message)) { + $message = json_encode($message); + } $this->handler->write($level, $message); } } diff --git a/src/SplitIO/Sdk/Client.php b/src/SplitIO/Sdk/Client.php index 921123e1..88b27b87 100644 --- a/src/SplitIO/Sdk/Client.php +++ b/src/SplitIO/Sdk/Client.php @@ -19,6 +19,7 @@ class Client implements ClientInterface private $evaluator = null; private $impressionListener = null; + private $queueMetadata = null; /** * Flag to get Impression's labels feature enabled diff --git a/src/SplitIO/TreatmentImpression.php b/src/SplitIO/TreatmentImpression.php index bb4743e0..f7ff2b14 100644 --- a/src/SplitIO/TreatmentImpression.php +++ b/src/SplitIO/TreatmentImpression.php @@ -15,8 +15,8 @@ class TreatmentImpression public static function log($impressions, QueueMetadataMessage $metadata) { try { - Di::getLogger()->debug($impressions); if (is_null($impressions) || (is_array($impressions) && 0 == count($impressions))) { + Di::getLogger()->debug("no impressions were sent"); return null; } $impressionCache = new ImpressionCache(); diff --git a/src/SplitIO/Version.php b/src/SplitIO/Version.php index bffb80b6..ca529eab 100644 --- a/src/SplitIO/Version.php +++ b/src/SplitIO/Version.php @@ -3,5 +3,5 @@ class Version { - const CURRENT = '7.1.5'; + const CURRENT = '7.1.6-rc1'; } diff --git a/tests/Suite/Sdk/SdkReadOnlyTest.php b/tests/Suite/Sdk/SdkReadOnlyTest.php index 4eecef8a..732635c1 100644 --- a/tests/Suite/Sdk/SdkReadOnlyTest.php +++ b/tests/Suite/Sdk/SdkReadOnlyTest.php @@ -90,7 +90,7 @@ public function testException() ->getMock(); // Discard (ignore) first logging statement - $logger->expects($this->exactly(2)) + $logger->expects($this->exactly(1)) ->method('debug'); $logger->expects($this->exactly(2)) From 72b87c676ef46644d8e33a7f987258da2a04d883 Mon Sep 17 00:00:00 2001 From: Matias Melograno Date: Tue, 7 Feb 2023 18:14:43 -0300 Subject: [PATCH 2/4] prep release --- CHANGES.txt | 2 +- src/SplitIO/Version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 65e17c58..17696e06 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,4 @@ -7.1.6 (Feb XX, 2023) +7.1.6 (Feb 08, 2023) - Fixed logging on array conversion. 7.1.5 (Oct 28, 2022) diff --git a/src/SplitIO/Version.php b/src/SplitIO/Version.php index ca529eab..b827e7d0 100644 --- a/src/SplitIO/Version.php +++ b/src/SplitIO/Version.php @@ -3,5 +3,5 @@ class Version { - const CURRENT = '7.1.6-rc1'; + const CURRENT = '7.1.6'; } From eb1093da22fa05708602d6e5a6aa7031b73edf20 Mon Sep 17 00:00:00 2001 From: Matias Melograno Date: Tue, 7 Feb 2023 18:16:24 -0300 Subject: [PATCH 3/4] added php 8.2 in ci --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 71932840..6d9b5114 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: - 6379:6379 strategy: matrix: - version: ['7.3', '8.0', '8.1'] + version: ['7.3', '8.0', '8.1', '8.2'] steps: - name: Checkout code uses: actions/checkout@v2 From 19b466ae471a74dc6a39131d581e79ba57b2f0f5 Mon Sep 17 00:00:00 2001 From: Matias Melograno Date: Tue, 14 Feb 2023 18:13:30 -0300 Subject: [PATCH 4/4] prepare release --- CHANGES.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index 17696e06..9f75675d 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,4 @@ -7.1.6 (Feb 08, 2023) +7.1.6 (Feb 14, 2023) - Fixed logging on array conversion. 7.1.5 (Oct 28, 2022)