rusefi_Console file logging: text messages? fix #3304

This commit is contained in:
rusefillc 2021-10-03 18:25:04 -04:00
parent 00579af8a0
commit 89bc4d482a
1 changed files with 7 additions and 4 deletions

View File

@ -1,5 +1,6 @@
package com.rusefi; package com.rusefi;
import com.devexperts.logging.Logging;
import com.opensr5.Logger; import com.opensr5.Logger;
import com.rusefi.util.LazyFile; import com.rusefi.util.LazyFile;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
@ -88,10 +89,12 @@ public enum FileLog {
private FileOutputStream openLog() throws FileNotFoundException { private FileOutputStream openLog() throws FileNotFoundException {
String date = Logger.getDate(); String date = Logger.getDate();
createFolderIfNeeded(); createFolderIfNeeded();
currentLogName = name() + "_rfi_report_" + date + ".csv"; String shortFileName = name() + "_rfi_report_" + date;
String fileName = Logger.DIR + currentLogName; Logging.configureLogFile(Logger.DIR + shortFileName + ".log");
rlog("Writing to " + fileName); currentLogName = shortFileName + ".csv";
return new FileOutputStream(fileName, true); String fullFileName = Logger.DIR + currentLogName;
rlog("Writing to " + fullFileName);
return new FileOutputStream(fullFileName, true);
} }
public static void createFolderIfNeeded() { public static void createFolderIfNeeded() {