/** 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
e.printStackTrace();\r
}\r
\r
- /**\r
- * Gets a property value\r
- * \r
- * @return null when defaultValue is ""\r
- */\r
- public static String getProperty(String name, String defaultValue) {\r
- final String value;\r
- if (defaultValue != null)\r
- value = System.getProperty(name, defaultValue);\r
- else\r
- value = System.getProperty(name);\r
-\r
- if (value == null || value.equals(""))\r
- return null;\r
- else\r
- return value;\r
- }\r
-\r
- public static String getProperty(String name) {\r
- return getProperty(name, null);\r
- }\r
-\r
public static String stateAsString(int state) {\r
switch (state) {\r
case Bundle.UNINSTALLED:\r