Skip to content

Commit

Permalink
CIRC-2099 added loggers
Browse files Browse the repository at this point in the history
  • Loading branch information
SreejaMangarapu committed Jul 16, 2024
1 parent 949689a commit a11ae99
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public class CirculationSetting {
private final JsonObject value;

public static CirculationSetting from(JsonObject representation) {
log.info("from {}", representation);
final var id = getProperty(representation, ID_FIELD);
final var name = getProperty(representation, NAME_FIELD);
final var value = getObjectProperty(representation, VALUE_FIELD);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,13 @@ public CompletableFuture<Result<CirculationSetting>> getById(String id) {

public CompletableFuture<Result<MultipleRecords<CirculationSetting>>> findBy(String query) {
return circulationSettingsStorageClient.getManyWithRawQueryStringParameters(query)
.thenApply(flatMapResult(response ->
MultipleRecords.from(response, CirculationSetting::from, RECORDS_PROPERTY_NAME)));
.thenApply(flatMapResult(response -> {
log.info("************* {}", response);
log.info(MultipleRecords.from(response, CirculationSetting::from, RECORDS_PROPERTY_NAME).value().getRecords());
return MultipleRecords.from(response, CirculationSetting::from, RECORDS_PROPERTY_NAME);
}
));

}

public CompletableFuture<Result<CirculationSetting>> create(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@ void create(RoutingContext routingContext) {
private static Function<PrintEventRequest, CompletableFuture<Result<PrintEventRequest>>> validatePrintEventFeatureFlag(
CirculationSettingsRepository circulationSettingsRepository) {
return printEventRequest -> circulationSettingsRepository.findBy(formatString(PRINT_EVENT_FLAG_QUERY))
.thenApply(result -> handleCirculationSettingResult(result.map(MultipleRecords::getRecords), printEventRequest));
.thenApply(result -> {
log.info("validatePrintEventFeatureFlag:: result value {}", result.value());
log.info("validatePrintEventFeatureFlag:: result value {}", result.value().getRecords());
return handleCirculationSettingResult(result.map(MultipleRecords::getRecords), printEventRequest);
});
}

private static Result<PrintEventRequest> handleCirculationSettingResult(Result<Collection<CirculationSetting>> result,
Expand Down

0 comments on commit a11ae99

Please sign in to comment.