From 8b49e90f04b9e6c537833a93677cfdd6a5274ff9 Mon Sep 17 00:00:00 2001 From: pieterlukasse Date: Fri, 3 May 2024 20:05:20 +0200 Subject: [PATCH] fix: add more logging --- .../org/ohdsi/webapi/cohortcharacterization/CcController.java | 3 ++- .../CohortCharacterizationServiceTest.java | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/ohdsi/webapi/cohortcharacterization/CcController.java b/src/main/java/org/ohdsi/webapi/cohortcharacterization/CcController.java index d32f478a8..0ba410a10 100644 --- a/src/main/java/org/ohdsi/webapi/cohortcharacterization/CcController.java +++ b/src/main/java/org/ohdsi/webapi/cohortcharacterization/CcController.java @@ -468,7 +468,7 @@ public Response exportGenerationsResults( private Response prepareExecutionResultResponse(List reports) { try (ByteArrayOutputStream baos = new ByteArrayOutputStream(); ZipOutputStream zos = new ZipOutputStream(baos)) { - + System.out.println("Found reports: " + reports.size()); for (Report report : reports) { createZipEntry(zos, report); } @@ -490,6 +490,7 @@ private void createZipEntry(ZipOutputStream zos, Report report) throws IOExcepti StringWriter sw = new StringWriter(); CSVWriter csvWriter = new CSVWriter(sw, ',', CSVWriter.DEFAULT_QUOTE_CHARACTER, CSVWriter.DEFAULT_ESCAPE_CHARACTER); csvWriter.writeAll(report.header); + System.out.println("Writing report " + report.getResultArray()); csvWriter.writeAll(report.getResultArray()); csvWriter.flush(); diff --git a/src/test/java/org/ohdsi/webapi/cohortcharacterization/CohortCharacterizationServiceTest.java b/src/test/java/org/ohdsi/webapi/cohortcharacterization/CohortCharacterizationServiceTest.java index 3d0882cd8..1505bdb38 100644 --- a/src/test/java/org/ohdsi/webapi/cohortcharacterization/CohortCharacterizationServiceTest.java +++ b/src/test/java/org/ohdsi/webapi/cohortcharacterization/CohortCharacterizationServiceTest.java @@ -214,6 +214,7 @@ private ZipFile getZipFile(Long id, ParamItem paramItem) throws IOException { for (String line : lines) { System.out.println(line); } + System.out.println("End of File Contents."); } catch (IOException e) { System.out.println("Error reading file."); e.printStackTrace();