public static void dprintStackTrace(PrintStream out, int frame, String title, String msg, Throwable excp) { if (isDebugMode()) { if (out == null) { out = printStackTrace_Stream; } if ((out != null) && (out != System.out) && (out != System.err)) { String m = (excp != null)? (msg + " (" + excp + ")") : msg; Print.println(null, frame + 1, "{log} " + m); } _printStackTrace(out, frame + 1, title, msg, excp); } }
public static void dprintln(PrintStream out, String msg) { if (isDebugMode()) { _println(out, 1, msg); } }
public static void dprintStackTrace(String title, String msg, Throwable excp) { if (isDebugMode()) { dprintStackTrace(null, 1, title, msg, excp); } }
public static void dprint(String msg) { if (isDebugMode()) { print(null, msg); } }
public static void printStackTrace(PrintStream out, int frame, String title, String msg, Throwable excp) { if (out == null) { out = printStackTrace_Stream; } if ((out != null) && (out != System.out) && (out != System.err)) { Print.print("\n"); if (excp != null) { String m = ((msg != null) && !msg.equals(""))? (msg + " - ") : ""; Print.println(null, frame + 1, "Error: " + m + excp + ""); StackTraceElement ste[] = excp.getStackTrace(); if (ste.length > 0) { Print.print(" ==> at " + getStackFrameString(ste[0]) + "\n"); } } else { Print.println(null, frame + 1, msg); } if (printStackTrace_LogFile != null) { Print.print("(Stack trace logged to '" + printStackTrace_LogFile + "')\n"); } Print.print("\n"); } _printStackTrace(out, frame + 1, title, msg, excp); }
public static void println(String msg) { _println(null, (printStackFrame()? 1 : -1), msg); }
Print.print(out, "\n"); Print.print(out, dashLine + errTitle); Print.print(out, "[" + Print.getStackFrameString(frame + 1) + "]\n"); if ((msg != null) && !msg.equals("")) { Print.print(out, msg + "\n"); } Print.print(out, excp.toString() + "\n"); Print.print(out, dashLine); excp.printStackTrace(out); } else { Print.print(out, dashLine); Print.print(out, "Stack Trace:\n"); Throwable t = new Throwable(); t.fillInStackTrace(); for (;st.hasMoreTokens();) { Print.println(out, st.nextToken()); } Print.print(out, dashLine); Print.print(out, "\n");
protected static void _println(PrintStream out, int frameNum, String msg) { String m = (frameNum >= 0)? "[" + getStackFrameString(frameNum + 1) + "] " + msg : msg; print(out, m + "\n"); }
public static String getStackFrameString(int frameNum, boolean showSrc) { return getStackFrameString(getStackFrame(frameNum + 1), showSrc); }
public static void printStackTrace(String msg, Throwable excp) { String title = (excp != null)? "Exception" : "StackTrace"; printStackTrace(null, 1, title, msg, excp); }
public static String getStackFrameString(StackTraceElement stackFrame) { return getStackFrameString(stackFrame, showStackFrameSource); }
public static void print(String msg) { print(null, msg); }
/** Add a listener to receive Progress events on deployment * actions. * * @param The listener to receive events * @see ProgressEvent */ public void addProgressListener(ProgressListener pol) { synchronized (listeners) { listeners.add(pol); if (deliveredEvents.size() > 0) { Print.dprintln("Delivering undelivered messages..."); for (Iterator i = deliveredEvents.iterator(); i.hasNext();) { pol.handleProgressEvent((ProgressEvent)i.next()); } } } }
public static void println(PrintStream out, String msg) { _println(out, (printStackFrame()? 1 : -1), msg); }
public static void dprint(PrintStream out, String msg) { if (isDebugMode()) { print(out, msg); } }
public static void printStackTrace(String title, String msg, Throwable excp) { printStackTrace(null, 1, title, msg, excp); }
public static String getStackFrameString(int frameNum) { return getStackFrameString(frameNum + 1, showStackFrameSource); }
public static void dprintln(String msg) { if (isDebugMode()) { _println(null, 1, msg); } }
public static void dprintStackTrace(String msg, Throwable excp) { if (isDebugMode()) { String title = (excp != null)? "(DEBUG) Exception" : "(DEBUG) StackTrace"; dprintStackTrace(null, 1, title, msg, excp); } }
public static void println(int frameNum, String msg) { int f = (frameNum >= 0)? (frameNum + 1) : (printStackFrame()? Math.abs(frameNum) : -1); _println(null, f, msg); }