Improvement: Text GUI: only log if status has changed
This commit is contained in:
@@ -106,7 +106,10 @@ public class GuiText implements Gui {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override public void status(String msg_, boolean overwriteSuspendedMsg) {
|
@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 (client != null && client.isSuspended()) {
|
||||||
if (overwriteSuspendedMsg) {
|
if (overwriteSuspendedMsg) {
|
||||||
@@ -114,9 +117,8 @@ public class GuiText implements Gui {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
String statusNew = msg_;
|
if (statusChanged) {
|
||||||
if (statusOld.equals(statusNew) == false) {
|
statusOld = msg_;
|
||||||
statusOld = statusNew;
|
|
||||||
System.out.println(String.format("%s %s", this.df.format(new Date()), msg_));
|
System.out.println(String.format("%s %s", this.df.format(new Date()), msg_));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user