mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-04-20 07:46:05 -04:00
Improce logging
This commit is contained in:
parent
807f5f2e50
commit
67a3c5d502
@ -113,7 +113,7 @@ public class Log {
|
||||
public static void logIfStressTests(String msg) {
|
||||
if (DevFlags.STRESS_TEST_MODE)
|
||||
System.err.println(new SimpleDateFormat("HH:mm:ss.SSS").format(new Date()) +
|
||||
msg +
|
||||
" - " + msg +
|
||||
" / Memory(MB): " + Profiler.getUsedMemory());
|
||||
}
|
||||
}
|
||||
|
@ -155,7 +155,9 @@ public class PeerManager implements ConnectionListener {
|
||||
|
||||
@Override
|
||||
public void onConnection(Connection connection) {
|
||||
Log.logIfStressTests("onConnection to peer " + networkNode.getAllConnections().size() + (connection.getPeersNodeAddressOptional().isPresent() ? connection.getPeersNodeAddressOptional().get() : "PeersNode unknown"));
|
||||
Log.logIfStressTests("onConnection to peer " +
|
||||
(connection.getPeersNodeAddressOptional().isPresent() ? connection.getPeersNodeAddressOptional().get() : "PeersNode unknown") +
|
||||
" / Nr. of connections: " + networkNode.getAllConnections().size());
|
||||
if (isSeedNode(connection))
|
||||
connection.setPeerType(Connection.PeerType.SEED_NODE);
|
||||
|
||||
@ -170,7 +172,9 @@ public class PeerManager implements ConnectionListener {
|
||||
|
||||
@Override
|
||||
public void onDisconnect(CloseConnectionReason closeConnectionReason, Connection connection) {
|
||||
Log.logIfStressTests("onDisconnect of peer " + networkNode.getAllConnections().size() + (connection.getPeersNodeAddressOptional().isPresent() ? connection.getPeersNodeAddressOptional().get() : "PeersNode unknown"));
|
||||
Log.logIfStressTests("onDisconnect of peer " +
|
||||
(connection.getPeersNodeAddressOptional().isPresent() ? connection.getPeersNodeAddressOptional().get() : "PeersNode unknown") +
|
||||
" / Nr. of connections: " + networkNode.getAllConnections().size());
|
||||
handleConnectionFault(connection);
|
||||
|
||||
lostAllConnections = networkNode.getAllConnections().isEmpty();
|
||||
|
@ -159,9 +159,11 @@ public class P2PDataStorage implements MessageListener, ConnectionListener {
|
||||
if (containsKey) {
|
||||
log.info("We remove the data as the data owner got disconnected with " +
|
||||
"closeConnectionReason=" + closeConnectionReason);
|
||||
|
||||
Log.logIfStressTests("We remove the data as the data owner got disconnected with " +
|
||||
"closeConnectionReason=" + closeConnectionReason +
|
||||
" / isIntended=" + closeConnectionReason.isIntended);
|
||||
" / isIntended=" + closeConnectionReason.isIntended +
|
||||
" / peer=" + (connection.getPeersNodeAddressOptional().isPresent() ? connection.getPeersNodeAddressOptional().get() : "PeersNode unknown"));
|
||||
|
||||
// TODO We get closeConnectionReason TERMINATED which removes offers which should not be removed
|
||||
// TODO investigate why EOFException happens
|
||||
|
Loading…
x
Reference in New Issue
Block a user