public static String getStackTrace(Throwable e, int limit) { return getStackTrace(e, limit, 0); }
public static String getStackTrace(Throwable e) { return getStackTrace(e, -1); }
public static String getStackTrace(Throwable e, int limit) { return getStackTrace(e, limit, 0); }
public static String getStackTrace(Throwable e) { return getStackTrace(e, -1); }
public static String getDebug(Throwable e, int max) { StringBuffer result = new StringBuffer(); String datetime = timestamp.format(new Date()).toLowerCase(); result.append(newline); result.append("Throwable: " + ((e == null) ? "" : ("(" + e.getClass().getName() + ")")) + ":" + datetime + newline); result.append("Throwable: " + ((e == null) ? "null" : e.getLocalizedMessage()) + newline); result.append(newline); result.append(getStackTrace(e, max)); result.append("Caught here:" + newline); result.append(getStackTrace(new Exception(), max, 1)); // Debug.dumpStack(); result.append(newline); return result.toString(); }
public static void dumpStack() { debug(getStackTrace(new Exception("Stack trace"), -1, 1)); }
public static void dumpStack(int limit) { debug(getStackTrace(new Exception("Stack trace"), limit, 1)); }
public static void dumpStack() { debug(getStackTrace(new Exception("Stack trace"), -1, 1)); }
public static void dumpStack(int limit) { debug(getStackTrace(new Exception("Stack trace"), limit, 1)); }
public static String getDebug(Throwable e, int max) { StringBuffer result = new StringBuffer(); String datetime = timestamp.format(new Date()).toLowerCase(); result.append(newline); result.append("Throwable: " + ((e == null) ? "" : ("(" + e.getClass().getName() + ")")) + ":" + datetime + newline); result.append("Throwable: " + ((e == null) ? "null" : e.getLocalizedMessage()) + newline); result.append(newline); result.append(getStackTrace(e, max)); result.append("Caught here:" + newline); result.append(getStackTrace(new Exception(), max, 1)); // Debug.dumpStack(); result.append(newline); return result.toString(); }