|
23 | 23 | import org.slf4j.LoggerFactory; |
24 | 24 |
|
25 | 25 | import java.util.ArrayList; |
| 26 | +import java.util.Arrays; |
26 | 27 | import java.util.Collections; |
27 | 28 | import java.util.HashMap; |
28 | 29 | import java.util.List; |
@@ -226,7 +227,7 @@ private SplitResult getTreatmentWithConfigInternal(String matchingKey, String bu |
226 | 227 | Object> attributes, MethodEnum methodEnum) { |
227 | 228 | long initTime = System.currentTimeMillis(); |
228 | 229 | try { |
229 | | - checkSDKReady(methodEnum); |
| 230 | + checkSDKReady(methodEnum, Arrays.asList(featureFlag)); |
230 | 231 |
|
231 | 232 | if (_container.isDestroyed()) { |
232 | 233 | _log.error("Client has already been destroyed - no calls possible"); |
@@ -290,7 +291,7 @@ private Map<String, SplitResult> getTreatmentsWithConfigInternal(String matching |
290 | 291 | return new HashMap<>(); |
291 | 292 | } |
292 | 293 | try { |
293 | | - checkSDKReady(methodEnum); |
| 294 | + checkSDKReady(methodEnum, featureFlagNames); |
294 | 295 | if (_container.isDestroyed()) { |
295 | 296 | _log.error("Client has already been destroyed - no calls possible"); |
296 | 297 | return createMapControl(featureFlagNames); |
@@ -360,10 +361,11 @@ private Event createEvent(String key, String trafficType, String eventType) { |
360 | 361 | return event; |
361 | 362 | } |
362 | 363 |
|
363 | | - private void checkSDKReady(MethodEnum methodEnum) { |
| 364 | + private void checkSDKReady(MethodEnum methodEnum, List<String> featureFlagNames) { |
| 365 | + String toPrint = featureFlagNames.size() == 1 ? featureFlagNames.get(0): String.join(",", featureFlagNames); |
364 | 366 | if (!_gates.isSDKReady()) { |
365 | | - _log.warn(String.format("%s: the SDK is not ready, results may be incorrect. Make sure to wait for SDK readiness " + |
366 | | - "before using this method", methodEnum.getMethod())); |
| 367 | + _log.warn(String.format("%s: the SDK is not ready, results may be incorrect for feature flag %s. Make sure to wait for " + |
| 368 | + "SDK readiness before using this method", methodEnum.getMethod(), toPrint)); |
367 | 369 | _telemetryConfigProducer.recordNonReadyUsage(); |
368 | 370 | } |
369 | 371 | } |
|
0 commit comments