Logging clean-up

Small commit towards improving the file log system.
This commit is contained in:
ronancpl
2017-05-19 20:07:33 -03:00
parent 36c3b7dea8
commit cb49edc3cd
7 changed files with 20 additions and 13 deletions

View File

@@ -11,7 +11,7 @@ import java.util.Calendar;
public class FilePrinter {
public static final String
ACCOUNT_STUCK = "accountStuck.txt",
ACCOUNT_STUCK = "accountStuck.txt",
EXCEPTION_CAUGHT = "exceptionCaught.txt",
CLIENT_START = "clientStartError.txt",
ADD_PLAYER = "addPlayer.txt",
@@ -39,11 +39,13 @@ public class FilePrinter {
PACKET_LOGS = "packetlogs/",
DELETED_CHARACTERS = "deletedchars/",
FREDRICK = "fredrick/",
NPC_UNCODED = "uncodedNPCs.txt",
QUEST_UNCODED = "uncodedQuests.txt",
SAVING_CHARACTER = "saveChar.txt";//more to come (maps)
NPC_UNCODED = "uncodedNPCs.txt",
QUEST_UNCODED = "uncodedQuests.txt",
SAVING_CHARACTER = "saveChar.txt",
USED_COMMANDS = "usedCommands.txt";//more to come (maps)
private static final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); //for file system purposes, it's nice to use yyyy-MM-dd
private static final String FILE_PATH = "logs/" + sdf.format(Calendar.getInstance().getTime()) + "/";// + sdf.format(Calendar.getInstance().getTime()) + "/"
private static final String FILE_PATH = "logs/" + sdf.format(Calendar.getInstance().getTime()) + "/"; // + sdf.format(Calendar.getInstance().getTime()) + "/"
private static final String ERROR = "error/";
public static void printError(final String name, final Throwable t) {
@@ -130,7 +132,7 @@ public class FilePrinter {
}
public static void print(final String name, final String s, boolean line) {
System.out.println("Error thrown: " + name);
System.out.println("Log: " + name);
System.out.println(s);
FileOutputStream out = null;
String file = FILE_PATH + name;