From 7ee3f5e04021ab3cd4c3b994722febdde7d9b864 Mon Sep 17 00:00:00 2001 From: teridax Date: Sun, 16 Jul 2023 00:27:03 +0200 Subject: [PATCH] changed logger file name due to incompatibility to windows --- src/me/teridax/jcash/Logging.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/me/teridax/jcash/Logging.java b/src/me/teridax/jcash/Logging.java index 289c357..e6ae15c 100644 --- a/src/me/teridax/jcash/Logging.java +++ b/src/me/teridax/jcash/Logging.java @@ -34,7 +34,7 @@ public final class Logging { private static void createFileLogger(Level level) { var now = LocalDateTime.now(); - var dateTime = DateTimeFormatter.ISO_DATE_TIME.format(now); + var dateTime = DateTimeFormatter.ofPattern("yyyy-MM-dd_HH-mm-ss").format(now); var logFileName = LOG_FOLDER_NAME + dateTime + ".log"; initializeLogFolder(); @@ -43,7 +43,7 @@ public final class Logging { var fh = new FileHandler(logFileName); fh.setLevel(level); LOGGER.addHandler(fh); - } catch (IOException e) { + } catch (Exception e) { LOGGER.warning("Unable to initialize logging for file: " + logFileName); } }