Supports null return values from AbstractWS#getRemoteIdentifier() in WS log messages

This commit is contained in:
Marc Baloup 2023-04-10 19:39:07 +02:00
parent ff954a3903
commit 0453a72587

View File

@ -275,6 +275,12 @@ public interface AbstractWS {
String getRemoteIdentifier(); String getRemoteIdentifier();
private String formatLogMessage(String message) { 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;
} }
} }