OSGi boot can update a non emptry configuration area
[lgpl/argeo-commons.git] / org.argeo.osgi.boot / src / org / argeo / osgi / boot / OsgiBootUtils.java
index da142cfe9b79c0a7327021e737209c93596f85ff..212e6baa4f208437cc217d4ab3a76df668b52549 100644 (file)
@@ -29,12 +29,16 @@ 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
+\r
        public static void info(Object obj) {\r
                System.out.println("# OSGiBOOT      # " + dateFormat.format(new Date()) + " # " + obj);\r
        }\r
 \r
        public static void debug(Object obj) {\r
-               System.out.println("# OSGiBOOT DBG  # " + dateFormat.format(new Date()) + " # " + obj);\r
+               if (debug)\r
+                       System.out.println("# OSGiBOOT DBG  # " + dateFormat.format(new Date()) + " # " + obj);\r
        }\r
 \r
        public static void warn(Object obj) {\r
@@ -47,7 +51,6 @@ public class OsgiBootUtils {
                        e.printStackTrace();\r
        }\r
 \r
-\r
        public static String stateAsString(int state) {\r
                switch (state) {\r
                case Bundle.UNINSTALLED:\r