Skip to content

Commit 294d61b

Browse files
fix(LENS-1799): logging improvements (#131)
* Modified Log Levels Changed logging level when adding a document to the queue to prevent large amounts of logging when pushing large numbers of documents. In addition removed a System.out.println statement. * Changed the log level Updated as I forgot to change the log level inside the if condition.
1 parent 68b7e68 commit 294d61b

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

src/main/java/com/coveo/pushapiclient/DocumentUploadQueue.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ public void add(DocumentBuilder document) throws IOException, InterruptedExcepti
6464
this.flush();
6565
}
6666
documentToAddList.add(document);
67-
logger.info("Adding document to batch: " + document.getDocument().uri);
67+
if (logger.isDebugEnabled()) {
68+
logger.debug("Adding document to batch: " + document.getDocument().uri);
69+
}
6870
this.size += sizeOfDoc;
6971
}
7072

@@ -86,7 +88,9 @@ public void add(DeleteDocument document) throws IOException, InterruptedExceptio
8688
this.flush();
8789
}
8890
documentToDeleteList.add(document);
89-
logger.info("Adding document to batch: " + document.documentId);
91+
if (logger.isDebugEnabled()) {
92+
logger.debug("Adding document to batch: " + document.documentId);
93+
}
9094
this.size += sizeOfDoc;
9195
}
9296

src/main/java/com/coveo/pushapiclient/StreamDocumentUploadQueue.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ public void add(PartialUpdateDocument document) throws IOException, InterruptedE
5656
this.flush();
5757
}
5858
documentToPartiallyUpdateList.add(document);
59-
logger.info("Adding document to batch: " + document.documentId);
59+
if (logger.isDebugEnabled()) {
60+
logger.debug("Adding document to batch: " + document.documentId);
61+
}
6062
this.size += sizeOfDoc;
6163
}
6264

src/main/java/com/coveo/pushapiclient/UpdateStreamService.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,6 @@ public HttpResponse<String> close()
218218
private UploadStrategy getUploadStrategy() {
219219
return (streamUpdate) -> {
220220
String batchUpdateJson = new Gson().toJson(streamUpdate.marshal());
221-
System.out.println(batchUpdateJson);
222221
return this.platformClient.uploadContentToFileContainer(fileContainer, batchUpdateJson);
223222
};
224223
}

0 commit comments

Comments
 (0)