Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(log-level) change single audience result to debug #254

Merged
merged 3 commits into from
Jun 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/optimizely/audience.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

#
# Copyright 2016-2017, 2019, Optimizely and contributors
# Copyright 2016-2017, 2019-2020, Optimizely and contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -84,7 +84,7 @@ def user_in_experiment?(config, experiment, attributes, logger)
result = ConditionTreeEvaluator.evaluate(audience_conditions, evaluate_custom_attr)
result_str = result.nil? ? 'UNKNOWN' : result.to_s.upcase
logger.log(
Logger::INFO,
Logger::DEBUG,
format(Helpers::Constants::AUDIENCE_EVALUATION_LOGS['AUDIENCE_EVALUATION_RESULT'], audience_id, result_str)
)
result
Expand Down
12 changes: 6 additions & 6 deletions spec/audience_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

#
# Copyright 2016-2017, 2019, Optimizely and contributors
# Copyright 2016-2017, 2019-2020, Optimizely and contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -253,7 +253,7 @@
)

expect(spy_logger).to have_received(:log).once.with(
Logger::INFO,
Logger::DEBUG,
"Audience '11154' evaluated to UNKNOWN."
)

Expand All @@ -265,7 +265,7 @@
)

expect(spy_logger).to have_received(:log).once.with(
Logger::INFO,
Logger::DEBUG,
"Audience '11155' evaluated to UNKNOWN."
)

Expand Down Expand Up @@ -299,7 +299,7 @@
).ordered # Order: 1

expect(spy_logger).to have_received(:log).once.with(
Logger::INFO,
Logger::DEBUG,
"Audience '3468206647' evaluated to FALSE."
).ordered # Order: 2

Expand All @@ -311,7 +311,7 @@
).ordered # Order: 3

expect(spy_logger).to have_received(:log).once.with(
Logger::INFO,
Logger::DEBUG,
"Audience '3988293898' evaluated to UNKNOWN."
).ordered # Order: 4

Expand All @@ -323,7 +323,7 @@
).ordered # Order: 5

expect(spy_logger).to have_received(:log).once.with(
Logger::INFO,
Logger::DEBUG,
"Audience '3468206646' evaluated to TRUE."
).ordered # Order: 6

Expand Down