X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fbin%2FCache.java;h=35d6aa381ff2e2e2fb783e37f77f5fb3acb60af5;hb=85283704c950febdca739d7dd857a1068cd73bbb;hp=4e4a0210d5ec4ef53786025ad5de77972a24e72d;hpb=9127252ea6d58c1ddf67507ed5d51c443240f250;p=jalview.git diff --git a/src/jalview/bin/Cache.java b/src/jalview/bin/Cache.java index 4e4a021..35d6aa3 100755 --- a/src/jalview/bin/Cache.java +++ b/src/jalview/bin/Cache.java @@ -1075,6 +1075,24 @@ public class Cache } /** + * Initial logging information helper for various versions output + * + * @param prefix + * @param value + * @param defaultValue + */ + private static void appendIfNotNull(StringBuilder sb, String prefix, + String value, String suffix, String defaultValue) + { + if (value == null && defaultValue == null) + { + return; + } + String line = prefix + (value != null ? value : defaultValue) + suffix; + sb.append(line); + } + + /** * * @return Jalview version, build details and JVM platform version for console */ @@ -1092,18 +1110,17 @@ public class Cache sb.append("\n"); sb.append(System.getProperty("os.arch") + " " + System.getProperty("os.name") + " " + System.getProperty("os.version")); sb.append("\n"); - System.out.println("Install4j version: " - + System.getProperty("sys.install4jVersion")); - System.out.println("Install4j template version: " - + System.getProperty("installer_template_version")); - System.out.println( - "Launcher version: " + System.getProperty("launcher_version")); - + appendIfNotNull(sb, "Install4j version: ", + System.getProperty("sys.install4jVersion"), "\n", null); + appendIfNotNull(sb, "Install4j template version: ", + System.getProperty("installer_template_version"), "\n", null); + appendIfNotNull(sb, "Launcher version: ", + System.getProperty("launcher_version"), "\n", null); if (jalview.bin.Cache.getDefault("VERSION", "TEST").equals("DEVELOPMENT")) { - sb.append("Getdown appdir: " + System.getProperty("getdownappdir")); - sb.append("\n"); - sb.append("Java home: " + System.getProperty("java.home")); - sb.append("\n"); + appendIfNotNull(sb, "Getdown appdir: ", + System.getProperty("getdownappdir"), "\n", null); + appendIfNotNull(sb, "Java home: ", System.getProperty("java.home"), + "\n", "unknown"); } return sb.toString(); }