Add peer address to error log

- Add full toString method to Connection.SharedModel
This commit is contained in:
Manfred Karrer 2019-01-02 00:34:19 +01:00
parent b48984c8f5
commit ccd90e763d
No known key found for this signature in database
GPG key ID: 401250966A6B2C46

View file

@ -678,10 +678,10 @@ public class Connection implements MessageListener {
// TODO sometimes we get StreamCorruptedException, OptionalDataException, IllegalStateException // TODO sometimes we get StreamCorruptedException, OptionalDataException, IllegalStateException
closeConnectionReason = CloseConnectionReason.UNKNOWN_EXCEPTION; closeConnectionReason = CloseConnectionReason.UNKNOWN_EXCEPTION;
log.warn("Unknown reason for exception at socket: {}\n\t" + log.warn("Unknown reason for exception at socket: {}\n\t" +
"connection={}\n\t" + "peer={}\n\t" +
"Exception={}", "Exception={}",
socket.toString(), socket.toString(),
this, connection.peersNodeAddressOptional,
e.toString()); e.toString());
e.printStackTrace(); e.printStackTrace();
} }
@ -700,7 +700,7 @@ public class Connection implements MessageListener {
} }
public void stop() { public void stop() {
this.stopped = true; stopped = true;
} }
public RuleViolation getRuleViolation() { public RuleViolation getRuleViolation() {
@ -709,10 +709,15 @@ public class Connection implements MessageListener {
@Override @Override
public String toString() { public String toString() {
return "SharedSpace{" + return "SharedModel{" +
"socket=" + socket + "\n connection=" + connection +
", ruleViolations=" + ruleViolations + ",\n socket=" + socket +
'}'; ",\n ruleViolations=" + ruleViolations +
",\n stopped=" + stopped +
",\n closeConnectionReason=" + closeConnectionReason +
",\n ruleViolation=" + ruleViolation +
",\n supportedCapabilities=" + supportedCapabilities +
"\n}";
} }
} }