X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.osgi.boot%2Fsrc%2Forg%2Fargeo%2Fosgi%2Fboot%2FOsgiBootUtils.java;h=212e6baa4f208437cc217d4ab3a76df668b52549;hb=86e5f79860a8b3013b40a36c1f06c828d52f5249;hp=da142cfe9b79c0a7327021e737209c93596f85ff;hpb=b33a1a30542169dc07f525b4d7d1baab7fa36564;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.osgi.boot/src/org/argeo/osgi/boot/OsgiBootUtils.java b/org.argeo.osgi.boot/src/org/argeo/osgi/boot/OsgiBootUtils.java index da142cfe9..212e6baa4 100644 --- a/org.argeo.osgi.boot/src/org/argeo/osgi/boot/OsgiBootUtils.java +++ b/org.argeo.osgi.boot/src/org/argeo/osgi/boot/OsgiBootUtils.java @@ -29,12 +29,16 @@ public class OsgiBootUtils { /** ISO8601 (as per log4j) and difference to UTC */ private static DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss,SSS Z"); + static boolean debug = Boolean.valueOf(System.getProperty(OsgiBoot.PROP_ARGEO_OSGI_BOOT_DEBUG, "false")) + .booleanValue(); + public static void info(Object obj) { System.out.println("# OSGiBOOT # " + dateFormat.format(new Date()) + " # " + obj); } public static void debug(Object obj) { - System.out.println("# OSGiBOOT DBG # " + dateFormat.format(new Date()) + " # " + obj); + if (debug) + System.out.println("# OSGiBOOT DBG # " + dateFormat.format(new Date()) + " # " + obj); } public static void warn(Object obj) { @@ -47,7 +51,6 @@ public class OsgiBootUtils { e.printStackTrace(); } - public static String stateAsString(int state) { switch (state) { case Bundle.UNINSTALLED: