Skip to content

Commit 4eceb97

Browse files
fix logging replacing %s with {} (#137)
1 parent 38b2fb8 commit 4eceb97

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

core-api/src/main/java/com/optimizely/ab/config/ProjectConfig.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ public boolean setForcedVariation(@Nonnull String experimentKey,
391391
if (removedVariationId != null) {
392392
Variation removedVariation = experiment.getVariationIdToVariationMap().get(removedVariationId);
393393
if (removedVariation != null) {
394-
logger.debug("Variation mapped to experiment \"%s\" has been removed for user \"%s\"", experiment.getKey(), userId);
394+
logger.debug("Variation mapped to experiment \"{}\" has been removed for user \"{}\"", experiment.getKey(), userId);
395395
}
396396
else {
397397
logger.debug("Removed forced variation that did not exist in experiment");
@@ -404,7 +404,7 @@ public boolean setForcedVariation(@Nonnull String experimentKey,
404404
}
405405
else {
406406
String previous = experimentToVariation.put(experiment.getId(), variation.getId());
407-
logger.debug("Set variation \"%s\" for experiment \"%s\" and user \"%s\" in the forced variation map.",
407+
logger.debug("Set variation \"{}\" for experiment \"{}\" and user \"{}\" in the forced variation map.",
408408
variation.getKey(), experiment.getKey(), userId);
409409
if (previous != null) {
410410
Variation previousVariation = experiment.getVariationIdToVariationMap().get(previous);
@@ -445,20 +445,20 @@ public boolean setForcedVariation(@Nonnull String experimentKey,
445445
if (experimentToVariation != null) {
446446
Experiment experiment = getExperimentKeyMapping().get(experimentKey);
447447
if (experiment == null) {
448-
logger.debug("No experiment \"%s\" mapped to user \"%s\" in the forced variation map ", experimentKey, userId);
448+
logger.debug("No experiment \"{}\" mapped to user \"{}\" in the forced variation map ", experimentKey, userId);
449449
return null;
450450
}
451451
String variationId = experimentToVariation.get(experiment.getId());
452452
if (variationId != null) {
453453
Variation variation = experiment.getVariationIdToVariationMap().get(variationId);
454454
if (variation != null) {
455-
logger.debug("Variation \"%s\" is mapped to experiment \"%s\" and user \"%s\" in the forced variation map",
455+
logger.debug("Variation \"{}\" is mapped to experiment \"{}\" and user \"{}\" in the forced variation map",
456456
variation.getKey(), experimentKey, userId);
457457
return variation;
458458
}
459459
}
460460
else {
461-
logger.debug("No variation for experiment \"%s\" mapped to user \"%s\" in the forced variation map ", experimentKey, userId);
461+
logger.debug("No variation for experiment \"{}\" mapped to user \"{}\" in the forced variation map ", experimentKey, userId);
462462
}
463463
}
464464
return null;

0 commit comments

Comments
 (0)