summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Fraser <george@fivetran.com>2018-12-27 14:39:27 -0800
committerGeorge Fraser <george@fivetran.com>2018-12-27 14:39:27 -0800
commita23d35939edaf22844b0170b0348f1f788aafbab (patch)
tree18c1cb9857b21bbafc92ba4f71639656031c661c /src
parent84982255bbcf53bec86e31b6cd4f7282169ccc5d (diff)
downloadjava-language-server-a23d35939edaf22844b0170b0348f1f788aafbab.zip
Log formatting
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/javacs/LogFormat.java2
-rw-r--r--src/main/java/org/javacs/Profiler.java8
2 files changed, 5 insertions, 5 deletions
diff --git a/src/main/java/org/javacs/LogFormat.java b/src/main/java/org/javacs/LogFormat.java
index 7bffbbd..24003eb 100644
--- a/src/main/java/org/javacs/LogFormat.java
+++ b/src/main/java/org/javacs/LogFormat.java
@@ -7,7 +7,7 @@ import java.util.logging.Formatter;
import java.util.logging.LogRecord;
class LogFormat extends Formatter {
- private final String format = "%1$tF\t%1$tT\t%4$s\t%2$s\t%5$s%6$s%n";
+ private final String format = "%1$tT.%1$tL\t%4$s\t%2$s\t%5$s%6$s%n";
private final Date dat = new Date();
@Override
diff --git a/src/main/java/org/javacs/Profiler.java b/src/main/java/org/javacs/Profiler.java
index 4dfabd4..43c0b80 100644
--- a/src/main/java/org/javacs/Profiler.java
+++ b/src/main/java/org/javacs/Profiler.java
@@ -29,14 +29,14 @@ class Profiler implements TaskListener {
}
void print() {
- var lines = new StringJoiner("\n\t");
+ var lines = new StringJoiner("; ");
for (var k : TaskEvent.Kind.values()) {
if (!profile.containsKey(k)) continue;
var elapsed = profile.get(k);
- var ms = elapsed.getSeconds() * 1000 + elapsed.getNano() / 1000 / 1000;
- lines.add(String.format("%s: %dms", k, ms));
+ var s = elapsed.getSeconds() + elapsed.getNano() / 1000.0 / 1000.0 / 1000.0;
+ lines.add(String.format("%s: %.3fs", k, s));
}
- LOG.info(String.format("Compiled %d files:\n\t%s", files.size(), lines));
+ LOG.info(String.format("Compiled %d files: %s", files.size(), lines));
}
private static final Logger LOG = Logger.getLogger("main");