1 19 package org.netbeans.modules.j2ee.websphere6.util; 20 21 28 public class WSDebug { 29 30 34 private static final String PROPERTY = "j2eeplugins.websphere6.debug"; 35 36 40 private static final String PREFIX = "j2eeplugins.websphere6 --- "; 41 42 47 private static boolean isEnabled = System. 48 getProperty(PROPERTY) != null; 50 53 public static boolean isEnabled() { 54 return isEnabled; 55 } 56 57 62 public static void notify(String message) { 63 System.out.println(PREFIX + message); } 65 66 73 public static void notify(Class clazz, String message) { 74 System.out.println("j2eeplugins.websphere6 --- [" + clazz.getName() + "]: " + message); } 77 78 83 public static void notify(Exception exception) { 84 exception.printStackTrace(System.out); 85 } 86 87 92 public static void notify(Object [] objects) { 93 System.out.println(PREFIX + objects); 94 for (int i = 0; i < objects.length; i++) { 95 System.out.println(PREFIX + objects[i]); 96 } 97 } 98 99 102 public static void printStack() { 103 StackTraceElement [] stack = new Exception ().getStackTrace(); 105 106 for (int i = 3; i < stack.length; i++) { 108 System.out.println(PREFIX + stack[i]); 110 } 111 } 112 113 } 114 | Popular Tags |