Merge branch 'fix/log-debug-ram' into 'master'

Fix: always save data in ram

See merge request sheepitrenderfarm/client!326
This commit is contained in:
Laurent Clouet
2024-07-13 12:11:41 +00:00

View File

@@ -83,18 +83,22 @@ public final class Log {
} }
private synchronized void append(int point_, String level_, String msg_) { private synchronized void append(int point_, String level_, String msg_) {
if (LEVEL_DEBUG.equals(level_) && this.debugLevel == false) {
return;
}
try { try {
int checkpointToWrite = (point_ > 0 ? point_ : this.lastCheckPoint); int checkpointToWrite = (point_ > 0 ? point_ : this.lastCheckPoint);
if ("".equals(msg_) == false) { if ("".equals(msg_) == false) {
String line = this.dateFormat.format(new Date()) + " (" + level_ + ") " + msg_; String line = this.dateFormat.format(new Date()) + " (" + level_ + ") " + msg_;
// always add to memory
if (this.checkpoints.containsKey(checkpointToWrite) && this.checkpoints.get(checkpointToWrite) != null) { if (this.checkpoints.containsKey(checkpointToWrite) && this.checkpoints.get(checkpointToWrite) != null) {
this.checkpoints.get(checkpointToWrite).add(line); this.checkpoints.get(checkpointToWrite).add(line);
} }
// DEBUG mode for not always use stdout/file
if (LEVEL_DEBUG.equals(level_) && this.debugLevel == false) {
return;
}
if (this.printStdOut) { if (this.printStdOut) {
System.out.println(line); System.out.println(line);
} }