fixed for one file

This commit is contained in:
minster586
2025-07-23 19:54:39 -04:00
parent 119e5a792c
commit 9ac8713782

View File

@@ -18,13 +18,12 @@ public class LogWriter {
private final String fileExtension;
public LogWriter(Plugin plugin) {
// Load config values
// Load values from config.yml
String formatString = plugin.getConfig().getString("timestamp-format", "h:mm a | MM-dd-yyyy");
this.timestampFormatter = new SimpleDateFormat(formatString);
this.fileExtension = plugin.getConfig().getString("log-extension", "csv").replace(".", "");
// Create folder structure
createFolder(baseFolder);
createFolder(zipFolder);
}
@@ -33,7 +32,7 @@ public class LogWriter {
String folderPath = baseFolder + category + "/";
createFolder(folderPath);
String fileName = "log_" + getTimeStamp("yyyy-MM-dd_HH-mm-ss") + "." + fileExtension;
String fileName = category + "." + fileExtension;
File file = new File(folderPath, fileName);
try (BufferedWriter writer = new BufferedWriter(new FileWriter(file, true))) {
@@ -72,7 +71,7 @@ public class LogWriter {
}
});
System.out.println("[ServerDevMode] Logs zipped to: " + zipName);
System.out.println("[ServerDevMode] Logs zipped to: " + zipFile.getName());
} catch (IOException e) {
System.err.println("Zip creation failed: " + e.getMessage());
}