From 8d452dc33751ac2dc0d86c0e517f7b798438c021 Mon Sep 17 00:00:00 2001 From: David Walluck Date: Wed, 28 Aug 2024 12:07:48 -0400 Subject: [PATCH] Add some minor fixes to logging (#686) --- .../pnc/deliverablesanalyzer/rest/AnalyzeResource.java | 8 ++++---- .../jboss/pnc/deliverablesanalyzer/rest/HttpClient.java | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/jboss/pnc/deliverablesanalyzer/rest/AnalyzeResource.java b/src/main/java/org/jboss/pnc/deliverablesanalyzer/rest/AnalyzeResource.java index 5c5f2568..1215a8b4 100644 --- a/src/main/java/org/jboss/pnc/deliverablesanalyzer/rest/AnalyzeResource.java +++ b/src/main/java/org/jboss/pnc/deliverablesanalyzer/rest/AnalyzeResource.java @@ -152,7 +152,7 @@ public Response analyze(AnalyzePayload analyzePayload) throws URISyntaxException LOGGER.info( "Analysis with ID {} was {} finished and callback was performed.", id, - analysisReport.isSuccess() ? "successfully" : "unsuccessfully"); + analysisReport != null && analysisReport.isSuccess() ? "successfully" : "unsuccessfully"); } finally { if (analyzePayload.getHeartbeat() != null) { heartbeatScheduler.unsubscribeRequest(id); @@ -224,10 +224,10 @@ private BuildConfig prepareConfig(String rawConfig) throws IOException { } /** - * Given a request and a map of http headers, add the http headers to the request if not already in the request + * Given a request and a map of HTTP headers, add the HTTP headers to the request if not already in the request * - * @param request - * @param httpHeaders + * @param request the request + * @param httpHeaders the HTTP headers */ private static void mergeHttpHeaders(Request request, Map httpHeaders) { diff --git a/src/main/java/org/jboss/pnc/deliverablesanalyzer/rest/HttpClient.java b/src/main/java/org/jboss/pnc/deliverablesanalyzer/rest/HttpClient.java index 39d7e436..487eda4e 100644 --- a/src/main/java/org/jboss/pnc/deliverablesanalyzer/rest/HttpClient.java +++ b/src/main/java/org/jboss/pnc/deliverablesanalyzer/rest/HttpClient.java @@ -86,7 +86,7 @@ public void performHttpRequest(Request request) throws Exception { * @throws IOException Thrown in case of the request failure */ public void performHttpRequest(Request request, Object payload) throws Exception { - LOGGER.debug("Performing HTTP request with these parameters: {}", request); + LOGGER.debug("Performing HTTP request with these parameters: {} (payload: {})", request, payload); Response response = null;