00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 package org.knopflerfish.framework;
00036
00037 import org.osgi.framework.BundleException;
00038
00039
00045 public class Debug {
00046
00050 static boolean classLoader = "true".equalsIgnoreCase(System.getProperty("org.knopflerfish.framework.debug.classloader"));
00051
00052
00056 static boolean errors = "true".equalsIgnoreCase(System.getProperty("org.knopflerfish.framework.debug.errors"));
00057
00058
00062 static boolean packages = "true".equalsIgnoreCase(System.getProperty("org.knopflerfish.framework.debug.packages"));
00063
00067 static boolean startlevel = "true".equalsIgnoreCase(System.getProperty("org.knopflerfish.framework.debug.startlevel"));
00068
00072 static boolean url = "true".equalsIgnoreCase(System.getProperty("org.knopflerfish.framework.debug.url"));
00073
00077 static boolean ldap = "true".equalsIgnoreCase(System.getProperty("org.knopflerfish.framework.debug.ldap"));
00078
00079
00083 static void println(String str) {
00084 System.out.println("## DEBUG: " + str);
00085 }
00086
00090 static void printStackTrace(String str, Throwable t) {
00091 System.out.println("## DEBUG: " + str);
00092 t.printStackTrace();
00093 if (t instanceof BundleException) {
00094 Throwable n = ((BundleException)t).getNestedException();
00095 if (n != null) {
00096 System.out.println("Nested bundle exception:");
00097 n.printStackTrace();
00098 }
00099 }
00100 }
00101
00102 }