public static void log(String item, double price, String seller) {
LocalDateTime now = LocalDateTime.now();
String time= now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
String entry = String.format("Куплено: %s\nЦена: %.2f\nПродавец: %s\nВремя: %s\n\n", item, price, seller, time);
try (FileWriter writer = new FileWriter(FILE_NAME, true)) {
writer.write(entry);
} catch (IOException e) {
System.out.println("Ошибка: " + e.getMessage());
}
}