Fixes logging error - GH-89

This commit is contained in:
Sotr
2019-05-05 14:01:02 +08:00
parent 2215a2da9f
commit d8ed5e7ff5

View File

@@ -10,12 +10,16 @@ import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.regex.Pattern;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.bukkit.Bukkit;
import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.configuration.file.YamlConfiguration;
@SuppressWarnings({"UnusedIsStillUsed", "unused"})
public class AkarinGlobalConfig {
private final static Logger LOGGER = LogManager.getLogger("Akarin");
private static File CONFIG_FILE;
private static final String HEADER = "This is the global configuration file for Akarin.\n"
+ "Some options may impact gameplay, so use with caution,\n"
@@ -33,7 +37,7 @@ public class AkarinGlobalConfig {
config.load(CONFIG_FILE);
} catch (IOException ex) {
} catch (InvalidConfigurationException ex) {
Bukkit.getLogger().severe("Could not load akarin.yml, please correct your syntax errors");
LOGGER.error("Could not load akarin.yml, please correct your syntax errors");
ex.printStackTrace();
throw Throwables.propagate(ex);
}
@@ -55,7 +59,7 @@ public class AkarinGlobalConfig {
} catch (InvocationTargetException ex) {
throw Throwables.propagate(ex.getCause());
} catch (Exception ex) {
Bukkit.getLogger().severe("Error invoking " + method);
LOGGER.error("Error invoking " + method);
ex.printStackTrace();
}
}
@@ -65,7 +69,7 @@ public class AkarinGlobalConfig {
try {
config.save(CONFIG_FILE);
} catch (IOException ex) {
Bukkit.getLogger().severe("Could not save " + CONFIG_FILE);
LOGGER.error("Could not save " + CONFIG_FILE);
ex.printStackTrace();
}
}