Skip to content

Commit 1e4247b

Browse files
authored
fix(log-level) change single audience result to debug (#254)
1 parent ac283eb commit 1e4247b

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

lib/optimizely/audience.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22

33
#
4-
# Copyright 2016-2017, 2019, Optimizely and contributors
4+
# Copyright 2016-2017, 2019-2020, Optimizely and contributors
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.
@@ -84,7 +84,7 @@ def user_in_experiment?(config, experiment, attributes, logger)
8484
result = ConditionTreeEvaluator.evaluate(audience_conditions, evaluate_custom_attr)
8585
result_str = result.nil? ? 'UNKNOWN' : result.to_s.upcase
8686
logger.log(
87-
Logger::INFO,
87+
Logger::DEBUG,
8888
format(Helpers::Constants::AUDIENCE_EVALUATION_LOGS['AUDIENCE_EVALUATION_RESULT'], audience_id, result_str)
8989
)
9090
result

spec/audience_spec.rb

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22

33
#
4-
# Copyright 2016-2017, 2019, Optimizely and contributors
4+
# Copyright 2016-2017, 2019-2020, Optimizely and contributors
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.
@@ -253,7 +253,7 @@
253253
)
254254

255255
expect(spy_logger).to have_received(:log).once.with(
256-
Logger::INFO,
256+
Logger::DEBUG,
257257
"Audience '11154' evaluated to UNKNOWN."
258258
)
259259

@@ -265,7 +265,7 @@
265265
)
266266

267267
expect(spy_logger).to have_received(:log).once.with(
268-
Logger::INFO,
268+
Logger::DEBUG,
269269
"Audience '11155' evaluated to UNKNOWN."
270270
)
271271

@@ -299,7 +299,7 @@
299299
).ordered # Order: 1
300300

301301
expect(spy_logger).to have_received(:log).once.with(
302-
Logger::INFO,
302+
Logger::DEBUG,
303303
"Audience '3468206647' evaluated to FALSE."
304304
).ordered # Order: 2
305305

@@ -311,7 +311,7 @@
311311
).ordered # Order: 3
312312

313313
expect(spy_logger).to have_received(:log).once.with(
314-
Logger::INFO,
314+
Logger::DEBUG,
315315
"Audience '3988293898' evaluated to UNKNOWN."
316316
).ordered # Order: 4
317317

@@ -323,7 +323,7 @@
323323
).ordered # Order: 5
324324

325325
expect(spy_logger).to have_received(:log).once.with(
326-
Logger::INFO,
326+
Logger::DEBUG,
327327
"Audience '3468206646' evaluated to TRUE."
328328
).ordered # Order: 6
329329

0 commit comments

Comments
 (0)