Skip to content

Commit

Permalink
Merge pull request #79 from configcat/evaluation-log-fix
Browse files Browse the repository at this point in the history
move evaluation logs from info level to debug
  • Loading branch information
kp-cat authored Jul 27, 2022
2 parents bf3aefc + 5454135 commit 0b3c093
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions lib/config_cat/rollout.ex
Original file line number Diff line number Diff line change
Expand Up @@ -139,23 +139,23 @@ defmodule ConfigCat.Rollout do

defp base_value(setting_descriptor, default_value) do
result = Map.get(setting_descriptor, Constants.value(), default_value)
Logger.info("Returning #{result}")
Logger.debug("Returning #{result}")

result
end

defp log_evaluating(key) do
Logger.info("Evaluating get_value('#{key}').")
Logger.debug("Evaluating get_value('#{key}').")
end

defp log_match(comparison_attribute, user_value, comparator, comparison_value, value) do
Logger.info(
Logger.debug(
"Evaluating rule: [#{comparison_attribute}:#{user_value}] [#{Comparator.description(comparator)}] [#{comparison_value}] => match, returning: #{value}"
)
end

defp log_no_match(comparison_attribute, user_value, comparator, comparison_value) do
Logger.info(
Logger.debug(
"Evaluating rule: [#{comparison_attribute}:#{user_value}] [#{Comparator.description(comparator)}] [#{comparison_value}] => no match"
)
end
Expand All @@ -173,7 +173,7 @@ defmodule ConfigCat.Rollout do
end

defp log_valid_user(user) do
Logger.info("User object: #{inspect(user)}")
Logger.debug("User object: #{inspect(user)}")
end

defp log_nil_user(key) do
Expand Down
4 changes: 2 additions & 2 deletions samples/multi/lib/multi/application.ex
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ defmodule Multi.Application do

def start(_type, _args) do

# Info level logging helps to inspect the feature flag evaluation process.
# Debug level logging helps to inspect the feature flag evaluation process.
# Use the :warning level to avoid too detailed logging in your application.
Logger.configure(level: :info)
Logger.configure(level: :debug)

children = [
Supervisor.child_spec({ConfigCat, [sdk_key: @sdk_key_1, name: :first]}, id: :config_cat_1),
Expand Down
4 changes: 2 additions & 2 deletions samples/simple/lib/simple/application.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ defmodule Simple.Application do

def start(_type, _args) do

# Info level logging helps to inspect the feature flag evaluation process.
# Debug level logging helps to inspect the feature flag evaluation process.
# Use the :warning level to avoid too detailed logging in your application.
Logger.configure(level: :info)
Logger.configure(level: :debug)

children = [
{ConfigCat, [sdk_key: @sdk_key]},
Expand Down

0 comments on commit 0b3c093

Please sign in to comment.