Skip to content

Commit 8a29788

Browse files
committed
Add logging to main function
1 parent 8a64d06 commit 8a29788

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/main/java/fr/igred/nucleus/NucleusJ.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,9 @@ public static void runCLI(String[] args) {
8181

8282
public static void main(String[] args) {
8383
List<String> listArgs = Arrays.asList(args);
84+
LOGGER.info("Starting NucleusJ version: {}", Version.get());
8485

85-
/* Allow IJ threads from thread pool to timeout */
86+
// Allow threads from thread pool to timeout
8687
ThreadUtil.threadPoolExecutor.allowCoreThreadTimeOut(true);
8788

8889
if (listArgs.contains("-h") || listArgs.contains("-help")) {
@@ -92,13 +93,16 @@ public static void main(String[] args) {
9293
} else if (listArgs.contains("-nj") || listArgs.contains("-cli") || listArgs.contains("-CLI")) {
9394
runCLI(args);
9495
} else {
95-
LOGGER.info("Starting NucleusJ GUI...");
96+
LOGGER.info("Starting GUI...");
9697
SwingUtilities.invokeLater(() -> {
9798
MainGui gui = new MainGui();
9899
gui.setVisible(true);
99100
});
100101
}
102+
// Shutdown the thread pool executor to clean up resources
103+
LOGGER.info("Shutting down thread pool executor...");
101104
ThreadUtil.threadPoolExecutor.shutdown();
105+
LOGGER.info("NucleusJ is now closing.");
102106
}
103107

104108
}

0 commit comments

Comments
 (0)