Skip to content

Commit

Permalink
Fix logging
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgH93 committed Oct 20, 2023
1 parent 5899f71 commit 8d2e64c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ public String getUpdateChannel()
{
return channel;
}
else getLogger().log(Level.INFO, "Unknown update Channel: {}", channel);
else getLogger().log(Level.INFO, "Unknown update Channel: {0}", channel);
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ private void checkPriestsTable(final @NotNull Connection connection) throws SQLE
String primKey = rs.getString("Column_name");
if(!primKey.equalsIgnoreCase(fieldPriestID))
{
logger.log(Level.WARNING, "PriestId field name currently used ({}}) in the database does not math the configured one in the config ({}})!\n" +
"If you would like to change the name of the field please change both the name in the database and the config.\nChanging config to: {}",
logger.log(Level.WARNING, "PriestId field name currently used ({0}) in the database does not math the configured one in the config ({1})!\n" +
"If you would like to change the name of the field please change both the name in the database and the config.\nChanging config to: {2}",
new Object[]{ primKey, fieldPriestID, primKey });
dbConfig.getConfigE().set("Database.SQL.Tables.Fields.PriestID", primKey);
try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ public void loadAll()
}
else
{
logger.log(Level.WARNING, "Player {} for marriage {} has not been loaded. Skipping", new Object[]{ (player1 == null ? 1 : 2), sm.marryID });
logger.log(Level.WARNING, "Player {0} for marriage {1} has not been loaded. Skipping", new Object[]{ (player1 == null ? 1 : 2), sm.marryID });
}
}
logger.info("Marriages loaded into cache");
Expand All @@ -341,7 +341,7 @@ public void loadMarriage(final int marriageId)
MARRIAGE_PLAYER priest = (rs.getObject(fieldPriest) == null) ? null : playerFromId(connection, rs.getInt(fieldPriest));
if(player1 == null || player2 == null)
{
logger.log(Level.WARNING, "Failed to load marriage (id: {}) because one of its players could not be loaded successful!", marriageId);
logger.log(Level.WARNING, "Failed to load marriage (id: {0}) because one of its players could not be loaded successful!", marriageId);
return;
}
String surname = surnameEnabled ? rs.getString(fieldSurname) : null;
Expand Down Expand Up @@ -636,7 +636,7 @@ public void migratePlayer(final @NotNull MigrationPlayer player)
}
else
{
logger.log(Level.INFO, "No auto ID for player \"{}\", try to load id from database ...", player.name);
logger.log(Level.INFO, "No auto ID for player \"{0}\", try to load id from database ...", player.name);
try(PreparedStatement ps2 = connection.prepareStatement(queryLoadPlayer))
{
ps2.setString(1, player.uuid);
Expand All @@ -648,7 +648,7 @@ public void migratePlayer(final @NotNull MigrationPlayer player)
}
else
{
logger.log(Level.WARNING, ConsoleColor.RED + "No ID for player \"{}\", there is something wrong with this player! You should check that!" + ConsoleColor.RESET, player.name);
logger.log(Level.WARNING, ConsoleColor.RED + "No ID for player \"{0}\", there is something wrong with this player! You should check that!" + ConsoleColor.RESET, player.name);
return;
}
}
Expand Down Expand Up @@ -698,7 +698,7 @@ public void migrateMarriage(final @NotNull MigrationMarriage marriage)
}
else
{
logger.log(Level.WARNING, "No ID for marriage \"{} <-> {}\"!", new Object[]{marriage.player1.name, marriage.player2.name});
logger.log(Level.WARNING, "No ID for marriage \"{0} <-> {1}\"!", new Object[]{marriage.player1.name, marriage.player2.name});
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public abstract class BaseDatabase<MARRIAGE_MASTER extends MarriageMasterPlugin,

//region Messages
protected static final String MESSAGE_FILES_NO_LONGER_SUPPORTED = ConsoleColor.RED + "File based storage is no longer supported." + ConsoleColor.YELLOW + " Migrating to SQLite." + ConsoleColor.RESET;
protected static final String MESSAGE_UNKNOWN_DB_TYPE = ConsoleColor.RED + "Unknown database type \"{}\"!" + ConsoleColor.RESET;
protected static final String MESSAGE_UNKNOWN_DB_TYPE = ConsoleColor.RED + "Unknown database type \"{0}\"!" + ConsoleColor.RESET;
protected static final String MESSAGE_CLEANING_DB_CACHE = "Cleaning database cache.", MESSAGE_DB_CACHE_CLEANED = "Database cache cleaned.";
//endregion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

public abstract class PluginChannelCommunicatorBase
{
private static final String MESSAGE_UNKNOWN_COMMAND = ConsoleColor.YELLOW + "Received unknown command via plugin channel! Command: {} " + ConsoleColor.RESET;
private static final String MESSAGE_UNKNOWN_COMMAND = ConsoleColor.YELLOW + "Received unknown command via plugin channel! Command: {0} " + ConsoleColor.RESET;
protected static final String CHANNEL_MARRIAGE_MASTER = "marriagemaster:main", CHANNEL_BUNGEE_CORD = "BungeeCord";

protected final Logger logger;
Expand Down

0 comments on commit 8d2e64c

Please sign in to comment.