From 5518c40103f2cf88da1bbf7300381cd69b518883 Mon Sep 17 00:00:00 2001 From: Zvi Grinberg <75700623+zvigrinberg@users.noreply.github.com> Date: Wed, 3 Apr 2024 02:50:36 +0300 Subject: [PATCH] fix: logs should only printed in EXHORT_DEBUG=true (#100) Signed-off-by: Zvi Grinberg --- src/main/java/com/redhat/exhort/impl/ExhortApi.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/redhat/exhort/impl/ExhortApi.java b/src/main/java/com/redhat/exhort/impl/ExhortApi.java index 1e3010d5..25f3012c 100644 --- a/src/main/java/com/redhat/exhort/impl/ExhortApi.java +++ b/src/main/java/com/redhat/exhort/impl/ExhortApi.java @@ -88,7 +88,7 @@ public String getEndpoint() { public static final void main(String[] args) throws IOException, InterruptedException, ExecutionException { System.setProperty("EXHORT_DEV_MODE", "true"); AnalysisReport analysisReport = new ExhortApi() - .stackAnalysisMixed("/tmp/030324/requirements.txt").get().json; + .stackAnalysisMixed("/tmp/exhort_test_10582748308498949664/pom.xml").get().json; // ObjectMapper om = new ObjectMapper().configure(SerializationFeature.WRITE_EMPTY_JSON_ARRAYS, false); // System.out.println(om.writerWithDefaultPrettyPrinter().writeValueAsString(analysisReport)); // AnalysisReport analysisReport = new ExhortApi() @@ -184,7 +184,9 @@ static HttpClient.Version getHttpVersion() { private String commonHookBeginning(boolean startOfApi) { if(startOfApi) { generateClientRequestId(); - LOG.info("Start of exhort-java-api client"); + if (debugLoggingIsNeeded()) { + LOG.info("Start of exhort-java-api client"); + } } else { if(Objects.isNull(getClientRequestId())) {