mirror of
https://github.com/ProjectSWGCore/Holocore.git
synced 2026-10-16 06:12:52 -04:00
Moved logging into separate class and fixed ZoneService bug where if the name was rejected, the character would be created anyways
This commit is contained in:
@@ -27,9 +27,6 @@
|
||||
***********************************************************************************/
|
||||
package resources.control;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
import network.OutboundPacketService;
|
||||
import network.packets.Packet;
|
||||
import resources.config.ConfigFile;
|
||||
@@ -45,7 +42,6 @@ import resources.services.Config;
|
||||
public class Service implements IntentReceiver {
|
||||
|
||||
private static final OutboundPacketService outboundPacketService = new OutboundPacketService();
|
||||
private static final DateFormat LOG_FORMAT = new SimpleDateFormat("dd-mm-yy HH:mm:ss.SSS");
|
||||
|
||||
/**
|
||||
* Initializes this service. If the service returns false on this method
|
||||
@@ -164,19 +160,4 @@ public class Service implements IntentReceiver {
|
||||
return DataManager.getInstance().getLocalDatabase();
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs the string to the server log file, formatted to display the time,
|
||||
* tag and message.
|
||||
* @param tag the tag to use for the log
|
||||
* @param str the format string for the log
|
||||
* @param args the string format arguments, if specified
|
||||
*/
|
||||
public synchronized final void log(String tag, String str, Object ... args) {
|
||||
if (getConfig(ConfigFile.PRIMARY).getBoolean("DEBUG-SERVICES", true)) {
|
||||
String logStr = String.format(str, args);
|
||||
String log = String.format("%s [%s]: %s", LOG_FORMAT.format(System.currentTimeMillis()), tag, logStr);
|
||||
DataManager.getInstance().log(log);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user