Skip to content

Commit

Permalink
Record exceptions
Browse files Browse the repository at this point in the history
Exceptions will now be included in 'denizen debug -r' logs.
  • Loading branch information
mcmonkey4eva committed Nov 16, 2013
1 parent 668ee64 commit 29f4bc1
Showing 1 changed file with 8 additions and 1 deletion.
Expand Up @@ -187,6 +187,13 @@ public static void echoError(Throwable ex) {
}
else {
ex.printStackTrace();
if (dB.record) {
String prefix = ConsoleSender.dateFormat.format(new Date()) + " [SEVERE] ";
dB.Recording.append(URLEncoder.encode(prefix + ex.toString() + "\n"));
for (StackTraceElement ste: ex.getStackTrace()) {
dB.Recording.append(URLEncoder.encode(prefix + ste.toString() + "\n"));
}
}
}
}

Expand Down Expand Up @@ -272,7 +279,7 @@ private static class ConsoleSender {

// Bukkit CommandSender sends color nicely to the logger, so we'll use that.
static CommandSender commandSender = null;
static SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");
public static SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");
static boolean skipFooter = false;

// Use this method for sending a message
Expand Down

0 comments on commit 29f4bc1

Please sign in to comment.