Skip to content
Snippets Groups Projects
Commit 8fc83334 authored by Torsten Grote's avatar Torsten Grote
Browse files

Merge branch '1294-log-stack-traces' into 'master'

Log exception stacktraces

Closes #1294

See merge request akwizgran/briar!824
parents 5cd5fc7e c2154c81
No related branches found
No related tags found
No related merge requests found
......@@ -42,6 +42,22 @@ public class BriefLogFormatter extends Formatter {
tag = tag.substring(tag.lastIndexOf('.') + 1);
sb.append(tag).append(": ");
sb.append(record.getMessage());
Throwable t = record.getThrown();
if (t != null) {
sb.append('\n');
appendThrowable(sb, t);
}
return sb.toString();
}
private void appendThrowable(StringBuilder sb, Throwable t) {
sb.append(t);
for (StackTraceElement e : t.getStackTrace())
sb.append("\n at ").append(e);
Throwable cause = t.getCause();
if (cause != null) {
sb.append("\n Caused by: ");
appendThrowable(sb, cause);
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment