Use fixed Locale for LogLine number formatting

Keep consistency over bug reports (e.g. on my machine, the time stamp was with commas as decimal separators, but I've seen people with dots)
This commit is contained in:
Sibo Van Gool 2022-01-28 22:35:13 +01:00
parent e48804feab
commit ec8d88fa01

View File

@ -1,6 +1,7 @@
package net.sf.openrocket.logging; package net.sf.openrocket.logging;
import java.io.PrintWriter; import java.io.PrintWriter;
import java.util.Locale;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
/** /**
@ -127,7 +128,7 @@ public class LogLine implements Comparable<LogLine> {
public String toString() { public String toString() {
if (formattedMessage == null) { if (formattedMessage == null) {
String str; String str;
str = String.format("%4d %10.3f %-" + LogLevel.LENGTH + "s %s %s", str = String.format(Locale.ENGLISH, "%4d %10.3f %-" + LogLevel.LENGTH + "s %s %s",
count, timestamp / 1000.0, (level != null) ? level.toString() : "NULL", count, timestamp / 1000.0, (level != null) ? level.toString() : "NULL",
getLocation(), getLocation(),
message); message);