Makes the stargate logger private

This commit is contained in:
2021-10-23 14:25:46 +02:00
parent 7cc8685e26
commit deba2e5c2c
14 changed files with 60 additions and 41 deletions

View File

@ -53,7 +53,8 @@ public final class PortalFileHelper {
bufferedWriter.close();
} catch (Exception e) {
Stargate.logger.log(Level.SEVERE, "Exception while writing stargates to " + saveFileLocation + ": " + e);
Stargate.getConsoleLogger().log(Level.SEVERE, "Exception while writing stargates to " +
saveFileLocation + ": " + e);
}
}
@ -131,7 +132,7 @@ public final class PortalFileHelper {
if (database.exists()) {
return loadPortals(world, database);
} else {
Stargate.logger.info(Stargate.getString("prefix") + "{" + world.getName() +
Stargate.getConsoleLogger().info(Stargate.getString("prefix") + "{" + world.getName() +
"} No stargates for world ");
}
return false;
@ -158,8 +159,8 @@ public final class PortalFileHelper {
doPostLoadTasks(world);
return true;
} catch (Exception e) {
Stargate.logger.log(Level.SEVERE, "Exception while reading stargates from " + database.getName() +
": " + lineIndex);
Stargate.getConsoleLogger().log(Level.SEVERE, "Exception while reading stargates from " +
database.getName() + ": " + lineIndex);
e.printStackTrace();
}
return false;
@ -183,7 +184,7 @@ public final class PortalFileHelper {
//Check if the min. required portal data is present
String[] portalData = line.split(":");
if (portalData.length < 8) {
Stargate.logger.info(Stargate.getString("prefix") + "Invalid line - " + lineIndex);
Stargate.getConsoleLogger().info(Stargate.getString("prefix") + "Invalid line - " + lineIndex);
return;
}
@ -206,7 +207,7 @@ public final class PortalFileHelper {
int openCount = PortalHandler.openAlwaysOpenPortals();
//Print info about loaded stargates so that admins can see if all stargates loaded
Stargate.logger.info(String.format("%s{%s} Loaded %d stargates with %d set as always-on",
Stargate.getConsoleLogger().info(String.format("%s{%s} Loaded %d stargates with %d set as always-on",
Stargate.getString("prefix"), world.getName(), portalCount, openCount));
//Re-draw the signs in case a bug in the config prevented the portal from loading and has been fixed since
@ -270,7 +271,7 @@ public final class PortalFileHelper {
Stargate.setLine(sign, 3, Stargate.getString("signInvalidGate"));
sign.update();
Stargate.logger.info(Stargate.getString("prefix") + "Gate layout on line " + lineIndex +
Stargate.getConsoleLogger().info(Stargate.getString("prefix") + "Gate layout on line " + lineIndex +
" does not exist [" + gateName + "]");
}