mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-07-28 17:34:11 -04:00
Improve logging
This commit is contained in:
parent
6c0b51dc37
commit
61a925e816
1 changed files with 15 additions and 7 deletions
|
@ -43,6 +43,7 @@ public class BootstrapNode {
|
||||||
private static boolean running = true;
|
private static boolean running = true;
|
||||||
|
|
||||||
private final Environment env;
|
private final Environment env;
|
||||||
|
private boolean noPeersInfoPrinted;
|
||||||
|
|
||||||
public BootstrapNode(Environment env) {
|
public BootstrapNode(Environment env) {
|
||||||
this.env = env;
|
this.env = env;
|
||||||
|
@ -97,9 +98,11 @@ public class BootstrapNode {
|
||||||
log.info("Bootstrap node started with name " + name + " and port " + port);
|
log.info("Bootstrap node started with name " + name + " and port " + port);
|
||||||
new Thread(() -> {
|
new Thread(() -> {
|
||||||
while (running) {
|
while (running) {
|
||||||
log.info("List of all peers online ----------------------------");
|
if (peer.peerBean().peerMap().all().size() > 0) {
|
||||||
|
noPeersInfoPrinted = false;
|
||||||
|
log.info("Number of peers online = " + peer.peerBean().peerMap().all().size());
|
||||||
for (PeerAddress peerAddress : peer.peerBean().peerMap().all()) {
|
for (PeerAddress peerAddress : peer.peerBean().peerMap().all()) {
|
||||||
log.info(peerAddress.toString());
|
log.info("Peer: " + peerAddress.toString());
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
Thread.sleep(10000);
|
Thread.sleep(10000);
|
||||||
|
@ -107,6 +110,11 @@ public class BootstrapNode {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (noPeersInfoPrinted) {
|
||||||
|
log.info("No peers online");
|
||||||
|
noPeersInfoPrinted = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}).start();
|
}).start();
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue