aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/org/sonarsource/scanner/cli/Stats.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/sonarsource/scanner/cli/Stats.java')
-rw-r--r--src/main/java/org/sonarsource/scanner/cli/Stats.java13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/main/java/org/sonarsource/scanner/cli/Stats.java b/src/main/java/org/sonarsource/scanner/cli/Stats.java
index 128877b..0d9913a 100644
--- a/src/main/java/org/sonarsource/scanner/cli/Stats.java
+++ b/src/main/java/org/sonarsource/scanner/cli/Stats.java
@@ -19,14 +19,13 @@
*/
package org.sonarsource.scanner.cli;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
class Stats {
- private final Logs logger;
+ private static final Logger LOG = LoggerFactory.getLogger(Stats.class);
private long startTime;
- Stats(Logs logger) {
- this.logger = logger;
- }
-
Stats start() {
startTime = System.currentTimeMillis();
return this;
@@ -34,12 +33,12 @@ class Stats {
Stats stop() {
long stopTime = System.currentTimeMillis() - startTime;
- logger.info("Total time: " + formatTime(stopTime));
+ LOG.atInfo().addArgument(() -> formatTime(stopTime)).log("Total time: {}");
System.gc();
Runtime r = Runtime.getRuntime();
long mb = 1024L * 1024;
- logger.info("Final Memory: " + (r.totalMemory() - r.freeMemory()) / mb + "M/" + r.totalMemory() / mb + "M");
+ LOG.atInfo().addArgument((r.totalMemory() - r.freeMemory()) / mb + "M/" + r.totalMemory() / mb + "M").log("Final Memory: {}");
return this;
}