Ability to disable log with level ERROR if key not exists #34
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
We use feature hub to manage feature toggles
Also, we have 2 additional point
Issue
featurehub-java-sdk/client-java-core/src/main/java/io/featurehub/client/ClientFeatureRepository.java
Lines 247 to 259 in f6fd04b
When we try to get feature value in java (io.featurehub.client.ClientFeatureRepository#getFeatureState) first time, then we have such log for our applications
FeatureHub error: application requesting use of invalid key after initialization: XXX
.This happens only for the first request for the feature toggle (not existing in feature hub), after instance of application was restarted (because of java.util.Map#computeIfAbsent used)
So in monitoring of our applications we have error cases by logs
Fix
I try to provide an ability to skip this log by configuration, because looks like that is usual case when feature toggle not exists in feature hub