Scripting support
[lgpl/argeo-commons.git] / org.argeo.osgi.boot / src / org / argeo / osgi / boot / OsgiBootUtils.java
index e212126621b179e3326d9752cad28f36ddc660b2..455c96198b3d76f1e8c344608db3b1f08a0a6d54 100644 (file)
@@ -29,8 +29,8 @@ public class OsgiBootUtils {
        /** ISO8601 (as per log4j) and difference to UTC */\r
        private static DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss,SSS Z");\r
 \r
-       static boolean debug = Boolean.valueOf(System.getProperty(OsgiBoot.PROP_ARGEO_OSGI_BOOT_DEBUG, "false"))\r
-                       .booleanValue();\r
+       static boolean debug = System.getProperty(OsgiBoot.PROP_ARGEO_OSGI_BOOT_DEBUG) == null ? false\r
+                       : !System.getProperty(OsgiBoot.PROP_ARGEO_OSGI_BOOT_DEBUG).trim().equals("false");\r
 \r
        public static void info(Object obj) {\r
                System.out.println("# OSGiBOOT      # " + dateFormat.format(new Date()) + " # " + obj);\r
@@ -51,6 +51,10 @@ public class OsgiBootUtils {
                        e.printStackTrace();\r
        }\r
 \r
+       public static boolean isDebug() {\r
+               return debug;\r
+       }\r
+\r
        public static String stateAsString(int state) {\r
                switch (state) {\r
                case Bundle.UNINSTALLED:\r