Skip to content

Commit 5cb428c

Browse files
committed
fix(log-level) change single audience result to debug
1 parent df9df6d commit 5cb428c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Diff for: src/Optimizely/Utils/Validator.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* Copyright 2016-2019, Optimizely
3+
* Copyright 2016-2020, Optimizely
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
@@ -187,7 +187,7 @@ public static function isUserInExperiment($config, $experiment, $userAttributes,
187187
$result = $conditionTreeEvaluator->evaluate($audience->getConditionsList(), $evaluateCustomAttr);
188188
$resultStr = $result === null ? 'UNKNOWN' : strtoupper(var_export($result, true));
189189

190-
$logger->log(Logger::INFO, sprintf(
190+
$logger->log(Logger::DEBUG, sprintf(
191191
AudienceEvaluationLogs::AUDIENCE_EVALUATION_RESULT,
192192
$audienceId,
193193
$resultStr

Diff for: tests/UtilsTests/ValidatorLoggingTest.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* Copyright 2019, Optimizely
3+
* Copyright 2019-2020, Optimizely
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
@@ -80,7 +80,7 @@ public function testIsUserInExperimentEvaluatesAudienceIds()
8080
[Logger::DEBUG, "Starting to evaluate audience \"11155\" with conditions: [\"and\",[\"or\",[\"or\",{\"name\":\"browser_type\",\"type\":\"custom_attribute\",\"value\":\"chrome\"}]]]."],
8181
$this->collectedLogs
8282
);
83-
$this->assertContains([Logger::INFO, "Audience \"11155\" evaluated to UNKNOWN."], $this->collectedLogs);
83+
$this->assertContains([Logger::DEBUG, "Audience \"11155\" evaluated to UNKNOWN."], $this->collectedLogs);
8484
$this->assertContains([Logger::INFO, "Audiences for experiment \"test_experiment\" collectively evaluated to FALSE."], $this->collectedLogs);
8585
}
8686

@@ -105,15 +105,15 @@ public function testIsUserInExperimenEvaluatesAudienceConditions()
105105
$this->collectedLogs
106106
);
107107
$this->assertContains(
108-
[Logger::INFO, "Audience \"3468206642\" evaluated to FALSE."],
108+
[Logger::DEBUG, "Audience \"3468206642\" evaluated to FALSE."],
109109
$this->collectedLogs
110110
);
111111
$this->assertContains(
112112
[Logger::DEBUG, "Starting to evaluate audience \"3988293898\" with conditions: [\"and\",[\"or\",[\"or\",{\"name\":\"house\",\"type\":\"custom_attribute\",\"match\":\"substring\",\"value\":\"Slytherin\"}]]]."],
113113
$this->collectedLogs
114114
);
115115
$this->assertContains(
116-
[Logger::INFO, "Audience \"3988293898\" evaluated to TRUE."],
116+
[Logger::DEBUG, "Audience \"3988293898\" evaluated to TRUE."],
117117
$this->collectedLogs
118118
);
119119
$this->assertContains([Logger::INFO, "Audiences for experiment \"audience_combinations_experiment\" collectively evaluated to TRUE."], $this->collectedLogs);

0 commit comments

Comments
 (0)