[ARTEMIS-1171] Improve log readability around clustering

Issue: https://issues.apache.org/jira/browse/ARTEMIS-1171
This commit is contained in:
Ingo Weiss 2017-05-17 14:38:01 +01:00 committed by Clebert Suconic
parent 97843a023f
commit 744221dcb5
6 changed files with 16 additions and 14 deletions

View File

@ -129,8 +129,8 @@ public final class DiscoveryGroupConfiguration implements Serializable {
public String toString() {
return "DiscoveryGroupConfiguration{" +
"name='" + name + '\'' +
", refreshTimeout=" + refreshTimeout +
", discoveryInitialWaitTimeout=" + discoveryInitialWaitTimeout +
'}';
",\n refreshTimeout=" + refreshTimeout +
",\n discoveryInitialWaitTimeout=" + discoveryInitialWaitTimeout +
"}";
}
}

View File

@ -252,15 +252,16 @@ public class TransportConfiguration implements Serializable {
public static String toStringParameters(Map<String, Object> params, Map<String, Object> extraProps) {
StringBuilder str = new StringBuilder();
str.append("{");
if (params != null) {
if (!params.isEmpty()) {
str.append("?");
str.append("\n\t\t\t");
}
boolean first = true;
for (Map.Entry<String, Object> entry : params.entrySet()) {
if (!first) {
str.append("&");
str.append("\n\t\t\t");
}
String key = entry.getKey();
@ -280,7 +281,7 @@ public class TransportConfiguration implements Serializable {
if (extraProps != null) {
for (Map.Entry<String, Object> entry : extraProps.entrySet()) {
if (!first) {
str.append("&");
str.append("\n\t\t\t");
}
String key = entry.getKey();
@ -292,6 +293,7 @@ public class TransportConfiguration implements Serializable {
}
}
}
str.append("\n\t\t}");
return str.toString();
}

View File

@ -1476,12 +1476,12 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
return "ServerLocatorImpl (identity=" + identity +
") [initialConnectors=" +
Arrays.toString(initialConnectors == null ? new TransportConfiguration[0] : initialConnectors) +
", discoveryGroupConfiguration=" +
",\n discoveryGroupConfiguration=" +
discoveryGroupConfiguration +
"]";
}
return "ServerLocatorImpl [initialConnectors=" + Arrays.toString(initialConnectors == null ? new TransportConfiguration[0] : initialConnectors) +
", discoveryGroupConfiguration=" +
",\n discoveryGroupConfiguration=" +
discoveryGroupConfiguration +
"]";
}

View File

@ -149,6 +149,6 @@ public final class TopologyMemberImpl implements TopologyMember {
@Override
public String toString() {
return "TopologyMember[id = " + nodeId + ", connector=" + connector + ", backupGroupName=" + backupGroupName + ", scaleDownGroupName=" + scaleDownGroupName + "]";
return "TopologyMember[\n\t\tid = " + nodeId + "\n\t\tconnector=" + connector + "\n\t\tbackupGroupName=" + backupGroupName + "\n\t\tscaleDownGroupName=" + scaleDownGroupName + "]";
}
}

View File

@ -736,13 +736,13 @@ public class BridgeImpl implements Bridge, SessionFailureListener, SendAcknowled
@Override
public String toString() {
return this.getClass().getSimpleName() + "@" +
return "\n " + this.getClass().getSimpleName() + "@" +
Integer.toHexString(System.identityHashCode(this)) +
" [name=" +
"\n [name=" +
name +
", queue=" +
",\n queue=" +
queue +
" targetConnector=" +
"\n targetConnector=" +
this.serverLocator +
"]";
}

View File

@ -1961,7 +1961,7 @@ public class QueueImpl implements Queue {
@Override
public String toString() {
return "QueueImpl[name=" + name.toString() + ", postOffice=" + this.postOffice + ", temp=" + this.temporary + "]@" + Integer.toHexString(System.identityHashCode(this));
return "QueueImpl[name=" + name.toString() + ",\n postOffice=" + this.postOffice + ",\n temp=" + this.temporary + "]@" + Integer.toHexString(System.identityHashCode(this));
}
private synchronized void internalAddTail(final MessageReference ref) {