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