Skip to content

Commit 7c93bb6

Browse files
committed
only log config when we want to
1 parent 7938235 commit 7c93bb6

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

src/main/java/lol/hyper/customlauncher/ConfigHandler.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public class ConfigHandler {
3333
private final Logger logger = LogManager.getLogger(this);
3434

3535
public ConfigHandler() {
36-
loadConfig();
36+
loadConfig(true);
3737
}
3838

3939
public boolean showCogInvasionNotifications() {
@@ -75,7 +75,7 @@ private void setDefaults() {
7575
}
7676

7777
/** Load the config from disk into the JSON object. */
78-
public void loadConfig() {
78+
public void loadConfig(boolean log) {
7979
if (!CONFIG_FILE.exists()) {
8080
jsonObject = new JSONObject();
8181
} else {
@@ -95,9 +95,11 @@ public void loadConfig() {
9595
setDefaults();
9696
INSTALL_LOCATION = new File(jsonObject.getString("ttrInstallLocation"));
9797

98-
logger.info("Config version: " + jsonObject.getInt("version"));
99-
logger.info("showInvasionNotifications: " + showCogInvasionNotifications());
100-
logger.info("showFieldOfficeNotifications: " + showFieldOfficeNotifications());
101-
logger.info("ttrInstallLocation: " + INSTALL_LOCATION.getAbsolutePath());
98+
if (log) {
99+
logger.info("Config version: " + jsonObject.getInt("version"));
100+
logger.info("showInvasionNotifications: " + showCogInvasionNotifications());
101+
logger.info("showFieldOfficeNotifications: " + showFieldOfficeNotifications());
102+
logger.info("ttrInstallLocation: " + INSTALL_LOCATION.getAbsolutePath());
103+
}
102104
}
103105
}

src/main/java/lol/hyper/customlauncher/windows/ConfigWindow.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public class ConfigWindow extends JFrame {
3030
private final Logger logger = LogManager.getLogger(this);
3131

3232
public ConfigWindow(ConfigHandler configHandler) {
33-
configHandler.loadConfig();
33+
configHandler.loadConfig(false);
3434
JFrame frame = new JFrame("Configuration");
3535
frame.setSize(370, 270);
3636
frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);

0 commit comments

Comments
 (0)