Skip to content

Commit fb9ebd3

Browse files
committed
remove printStackTrace()
1 parent d96a22f commit fb9ebd3

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/main/java/cn/rocket/assaignmark/gui/Controller.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,15 @@ public class Controller {
6363
properties.load(in);
6464
toBeLoad = properties.getProperty("initialPath");
6565
} catch (IOException e) {
66-
e.printStackTrace();
66+
LogManager.getRootLogger().error("Failed to load initial path: ",e);
6767
}
6868
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
6969
if (openedPath != null) {
7070
try (FileOutputStream out = new FileOutputStream(propertiesFile)) {
7171
properties.setProperty("initialPath", openedPath);
7272
properties.store(out, null);
7373
} catch (IOException e) {
74-
e.printStackTrace();
74+
LogManager.getRootLogger().error("Failed to write properties file: ",e);
7575
}
7676
}
7777
}));

src/main/java/cn/rocket/assaignmark/gui/Launcher.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ public void start(Stage primaryStage) {
3939
try {
4040
scene = new Scene(loader.load());
4141
} catch (IOException e) {
42-
LogManager.getRootLogger().error("错误:" + e.getLocalizedMessage());
43-
e.printStackTrace();
42+
LogManager.getRootLogger().error("Failed to load fxml:",e);
4443
System.exit(1);
4544
}
4645
primaryStage.setTitle("赋分程序");

0 commit comments

Comments
 (0)