From e2e46736cf4da18b9efe2f54b1f23d8f56709da2 Mon Sep 17 00:00:00 2001 From: Matt Hooks <46452201+matt-dutchie@users.noreply.github.com> Date: Wed, 29 Mar 2023 09:32:50 -0500 Subject: [PATCH 1/2] Add key to error log for invalid context for easier debugging --- lib/ldclient-rb/ldclient.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ldclient-rb/ldclient.rb b/lib/ldclient-rb/ldclient.rb index 79a4f49c..a14d1372 100644 --- a/lib/ldclient-rb/ldclient.rb +++ b/lib/ldclient-rb/ldclient.rb @@ -387,7 +387,7 @@ def evaluate_internal(key, context, default, with_reasons) context = Impl::Context::make_context(context) unless context.valid? - @config.logger.error { "[LDClient] Context was invalid for flag evaluation (#{context.error}); returning default value" } + @config.logger.error { "[LDClient] Context was invalid for flag evaluation of key '#{key}' (#{context.error}); returning default value" } detail = Evaluator.error_result(EvaluationReason::ERROR_USER_NOT_SPECIFIED, default) return detail end From 9f496000092745b150e2af45d71e7245fd813faf Mon Sep 17 00:00:00 2001 From: Matt Hooks <46452201+matt-dutchie@users.noreply.github.com> Date: Thu, 30 Mar 2023 14:18:36 -0500 Subject: [PATCH 2/2] Update lib/ldclient-rb/ldclient.rb Co-authored-by: Matthew M. Keeler --- lib/ldclient-rb/ldclient.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ldclient-rb/ldclient.rb b/lib/ldclient-rb/ldclient.rb index a14d1372..2c515680 100644 --- a/lib/ldclient-rb/ldclient.rb +++ b/lib/ldclient-rb/ldclient.rb @@ -387,7 +387,7 @@ def evaluate_internal(key, context, default, with_reasons) context = Impl::Context::make_context(context) unless context.valid? - @config.logger.error { "[LDClient] Context was invalid for flag evaluation of key '#{key}' (#{context.error}); returning default value" } + @config.logger.error { "[LDClient] Context was invalid for evaluation of flag '#{key}' (#{context.error}); returning default value" } detail = Evaluator.error_result(EvaluationReason::ERROR_USER_NOT_SPECIFIED, default) return detail end