X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.osgi.boot%2Fsrc%2Forg%2Fargeo%2Fosgi%2Fboot%2FOsgiBootUtils.java;h=455c96198b3d76f1e8c344608db3b1f08a0a6d54;hb=5dc0e30ff215c1604b1b0e7bf8c8699f6cd1257f;hp=e212126621b179e3326d9752cad28f36ddc660b2;hpb=54e74b900b1c0f7b1de0def771de35e50a8d4071;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 e21212662..455c96198 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,8 +29,8 @@ 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(); + static boolean debug = System.getProperty(OsgiBoot.PROP_ARGEO_OSGI_BOOT_DEBUG) == null ? false + : !System.getProperty(OsgiBoot.PROP_ARGEO_OSGI_BOOT_DEBUG).trim().equals("false"); public static void info(Object obj) { System.out.println("# OSGiBOOT # " + dateFormat.format(new Date()) + " # " + obj); @@ -51,6 +51,10 @@ public class OsgiBootUtils { e.printStackTrace(); } + public static boolean isDebug() { + return debug; + } + public static String stateAsString(int state) { switch (state) { case Bundle.UNINSTALLED: