From: Fabrice Bellingard Date: Thu, 19 Jul 2012 13:25:27 +0000 (+0000) Subject: SONARPLUGINS-2038 Log the property only in Debug mode X-Git-Tag: 2.5-rc1~296 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c7d65715c793f962e154310aa2b1460ebcdd86b8;p=sonar-scanner-cli.git SONARPLUGINS-2038 Log the property only in Debug mode --- diff --git a/src/main/java/org/sonar/runner/Main.java b/src/main/java/org/sonar/runner/Main.java index dbb998a..009bf0e 100644 --- a/src/main/java/org/sonar/runner/Main.java +++ b/src/main/java/org/sonar/runner/Main.java @@ -43,6 +43,8 @@ import java.util.Properties; */ public final class Main { + private static boolean debugMode = false; + public static void main(String[] args) { long startTime = System.currentTimeMillis(); try { @@ -51,8 +53,11 @@ public final class Main { log("Runner version: " + runner.getRunnerVersion()); log("Java version: " + System.getProperty("java.version", "") + ", vendor: " + System.getProperty("java.vendor", "")); - log("OS name: \"" + System.getProperty("os.name") + "\", version: \"" + System.getProperty("os.version") + "\""); - log("Arch: \"" + System.getProperty("os.arch") + "\", sun.arch.data.model: \"" + System.getProperty("sun.arch.data.model") + "\""); + log("OS name: \"" + System.getProperty("os.name") + "\", version: \"" + System.getProperty("os.version") + "\", arch: \"" + System.getProperty("os.arch") + "\""); + if (debugMode) { + log("Other system properties:"); + log(" - sun.arch.data.model: \"" + System.getProperty("sun.arch.data.model") + "\""); + } log("Server: " + runner.getServerURL()); try { log("Work directory: " + runner.getWorkDir().getCanonicalPath()); @@ -166,6 +171,7 @@ public final class Main { } else if ("-X".equals(arg) || "--debug".equals(arg)) { props.setProperty(Runner.VERBOSE, "true"); + debugMode = true; } else if ("-D".equals(arg) || "--define".equals(arg)) { i++;