From 0453a7258704fdf92ddb4b4ecdde19fd3e9a3c5a Mon Sep 17 00:00:00 2001 From: Marc Baloup Date: Mon, 10 Apr 2023 19:39:07 +0200 Subject: [PATCH] Supports null return values from AbstractWS#getRemoteIdentifier() in WS log messages --- .../src/main/java/fr/pandacube/lib/ws/AbstractWS.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pandalib-ws/src/main/java/fr/pandacube/lib/ws/AbstractWS.java b/pandalib-ws/src/main/java/fr/pandacube/lib/ws/AbstractWS.java index 4067d12..eff2c1f 100644 --- a/pandalib-ws/src/main/java/fr/pandacube/lib/ws/AbstractWS.java +++ b/pandalib-ws/src/main/java/fr/pandacube/lib/ws/AbstractWS.java @@ -275,6 +275,12 @@ public interface AbstractWS { String getRemoteIdentifier(); private String formatLogMessage(String message) { - return "[WS/" + getClass().getSimpleName() + "] [" + getRemoteIdentifier() + "] " + message; + String remote = getRemoteIdentifier(); + String fullText = "[WS/" + getClass().getSimpleName() + "]"; + if (remote != null) { + fullText += " [" + remote + "]"; + } + fullText += message; + return fullText; } }