Improvement: Text GUI: only log if status has changed

This commit is contained in:
M*C*O
2025-08-20 12:54:14 +00:00
committed by Laurent Clouet
parent 42f7d506d2
commit 567922657c

View File

@@ -106,7 +106,10 @@ public class GuiText implements Gui {
}
@Override public void status(String msg_, boolean overwriteSuspendedMsg) {
log.debug("GUI " + msg_);
boolean statusChanged = !statusOld.equals(msg_);
if (statusChanged) {
log.debug("GUI " + msg_);
}
if (client != null && client.isSuspended()) {
if (overwriteSuspendedMsg) {
@@ -114,9 +117,8 @@ public class GuiText implements Gui {
}
}
else {
String statusNew = msg_;
if (statusOld.equals(statusNew) == false) {
statusOld = statusNew;
if (statusChanged) {
statusOld = msg_;
System.out.println(String.format("%s %s", this.df.format(new Date()), msg_));
}
}