Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions java/src/org/openqa/selenium/grid/log/TerseFormatter.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class TerseFormatter extends Formatter {
* Line separator string. This is the value of the line.separator property at the moment that the
* TerseFormatter was created.
*/
private final String lineSeparator = System.getProperty("line.separator");
private final String lineSeparator = System.lineSeparator();

/*
* DGF - These have to be compile time constants to be used with switch
Expand Down Expand Up @@ -78,7 +78,12 @@ public synchronized String format(final LogRecord record) {
buffer.append(' ');
buffer.append(levelNumberToCommonsLevelName(record.getLevel()));
String[] parts = record.getSourceClassName().split("\\.");
buffer.append(" [" + parts[parts.length - 1] + "." + record.getSourceMethodName() + "]");
buffer
.append(" [")
.append(parts[parts.length - 1])
.append(".")
.append(record.getSourceMethodName())
.append("]");
buffer.append(SUFFIX);
buffer.append(formatMessage(record)).append(lineSeparator);
if (record.getThrown() != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public String format(LogRecord record) {
.append("]");
}
buffer.append(" - ");
buffer.append(formatMessage(record)).append(System.getProperty("line.separator"));
buffer.append(formatMessage(record)).append(System.lineSeparator());
if (record.getThrown() != null) {
final StringWriter trace = new StringWriter();
record.getThrown().printStackTrace(new PrintWriter(trace));
Expand Down