Fix: always save data in ram
This commit is contained in:
@@ -83,18 +83,22 @@ public final class Log {
|
||||
}
|
||||
|
||||
private synchronized void append(int point_, String level_, String msg_) {
|
||||
if (LEVEL_DEBUG.equals(level_) && this.debugLevel == false) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
int checkpointToWrite = (point_ > 0 ? point_ : this.lastCheckPoint);
|
||||
|
||||
if ("".equals(msg_) == false) {
|
||||
String line = this.dateFormat.format(new Date()) + " (" + level_ + ") " + msg_;
|
||||
|
||||
// always add to memory
|
||||
if (this.checkpoints.containsKey(checkpointToWrite) && this.checkpoints.get(checkpointToWrite) != null) {
|
||||
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) {
|
||||
System.out.println(line);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user