added support for non-threaded logging to WriterActiveObject

This commit is contained in:
NoName11234 2024-01-25 19:55:56 +01:00
parent 8f8ee9a385
commit c14dd6e97c
2 changed files with 23 additions and 6 deletions

View File

@ -2592,11 +2592,19 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
void writeLog(String str) {
if (log && finalresult) {
if(parallel){
logFile.write("Thread no.:" + thNo + "\n"
+ "noOfThread:" + noOfThread + "\n"
+ "parallel:" + parallel + "\n"
+ str+"\n\n"
);
}else{
logFile.writeNonThreaded("Thread no.:" + thNo + "\n"
+ "noOfThread:" + noOfThread + "\n"
+ "parallel:" + parallel + "\n"
+ str+"\n\n"
);
}
}
}

View File

@ -29,8 +29,17 @@ public class WriterActiveObject {
writer.write(message);
writer.flush();
} catch (IOException e) {
System.out.println(e.getMessage());
throw new RuntimeException(e);
}
});
}
public void writeNonThreaded(String message){
try {
writer.write(message);
writer.flush();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}