From 23847c2fabb7ea373f6a7faed9683ffd725f90db Mon Sep 17 00:00:00 2001 From: Josiah Witt Date: Tue, 22 Sep 2020 13:59:05 -0400 Subject: [PATCH 1/2] Make unknown feature flags at least a warning --- 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 1dc0cc25..f4ed2b8a 100644 --- a/lib/ldclient-rb/ldclient.rb +++ b/lib/ldclient-rb/ldclient.rb @@ -393,7 +393,7 @@ def evaluate_internal(key, user, default, event_factory) feature = @store.get(FEATURES, key) if feature.nil? - @config.logger.info { "[LDClient] Unknown feature flag \"#{key}\". Returning default value" } + @config.logger.warn { "[LDClient] Unknown feature flag \"#{key}\". Returning default value" } detail = error_result('FLAG_NOT_FOUND', default) @event_processor.add_event(event_factory.new_unknown_flag_event(key, user, default, detail.reason)) return detail From f4e6c3c9fe0fed4fb87d788f5de2f55ef31a2cd4 Mon Sep 17 00:00:00 2001 From: Josiah Witt Date: Tue, 22 Sep 2020 14:00:33 -0400 Subject: [PATCH 2/2] Add a few missing [LDClient] prefixes --- lib/ldclient-rb/ldclient.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/ldclient-rb/ldclient.rb b/lib/ldclient-rb/ldclient.rb index f4ed2b8a..1ecd96cc 100644 --- a/lib/ldclient-rb/ldclient.rb +++ b/lib/ldclient-rb/ldclient.rb @@ -240,7 +240,7 @@ def variation_detail(key, user, default) # def identify(user) if !user || user[:key].nil? - @config.logger.warn("Identify called with nil user or nil user key!") + @config.logger.warn("[LDClient] Identify called with nil user or nil user key!") return end sanitize_user(user) @@ -271,7 +271,7 @@ def identify(user) # def track(event_name, user, data = nil, metric_value = nil) if !user || user[:key].nil? - @config.logger.warn("Track called with nil user or nil user key!") + @config.logger.warn("[LDClient] Track called with nil user or nil user key!") return end sanitize_user(user) @@ -367,8 +367,8 @@ def create_default_data_source(sdk_key, config, diagnostic_accumulator) if config.stream? StreamProcessor.new(sdk_key, config, requestor, diagnostic_accumulator) else - config.logger.info { "Disabling streaming API" } - config.logger.warn { "You should only disable the streaming API if instructed to do so by LaunchDarkly support" } + config.logger.info { "[LDClient] Disabling streaming API" } + config.logger.warn { "[LDClient] You should only disable the streaming API if instructed to do so by LaunchDarkly support" } PollingProcessor.new(config, requestor) end end