Use the default line separator when logging

This commit is contained in:
Eric Scharff 2007-12-11 10:26:28 -07:00
parent 286f290665
commit ec653fbc1e

View File

@ -73,6 +73,11 @@ public class Logger {
private static final int NAME_WIDTH = 14; private static final int NAME_WIDTH = 14;
private static final int METHOD_WIDTH = 15; private static final int METHOD_WIDTH = 15;
private static final int LEVEL_WIDTH = 8; private static final int LEVEL_WIDTH = 8;
private final String newline;
public DefaultHandler() {
newline = System.getProperty("line.separator");
}
public Object clone() { return this; } public Object clone() { return this; }
public void close() { } public void close() { }
@ -84,7 +89,7 @@ public class Logger {
sb.append(t.getClass().getName()); sb.append(t.getClass().getName());
sb.append(": "); sb.append(": ");
sb.append(t.getMessage()); sb.append(t.getMessage());
sb.append('\n'); sb.append(newline);
for (StackTraceElement elt : t.getStackTrace()) { for (StackTraceElement elt : t.getStackTrace()) {
sb.append('\t'); sb.append('\t');
@ -102,7 +107,7 @@ public class Logger {
sb.append(lineNumber); sb.append(lineNumber);
} }
sb.append(')'); sb.append(')');
sb.append('\n'); sb.append(newline);
} }
maybeLogThrown(sb, t.getCause()); maybeLogThrown(sb, t.getCause());
} }