Simulates a printing of a stack trace by printing the string
stack trace
15011
public void printStackTrace(PrintStream printStream) {
    if (mStackTrace == null) {
      printStream.print(getMessage());
    }
    else {
      printStream.print(mStackTrace);
    }
  }
365583
def _makepretty(printout, stack):
    '''
    
    '''
    printout.write('======== Salt Debug Stack Trace =========\n')
    traceback.print_stack(stack, file=printout)
    printout.write('=========================================\n')
630818
public static void printStackTrace(final StackTraceElement[] stackTraces, final Logger logger, final LogLevel logLevel) {
        printStackTrace(null, stackTraces, logger, logLevel);
    }
1306421
def stack_trace(depth=None):
    
    frames = inspect.stack()[2:]
    if depth:
        frames = frames[:depth]
        
    result = StringIO()
    result.write("----------------------------------------------------\n")
    for (frame, file, line, context, code, status) in frames:
        result.write("In %s from %s\n%s %s" % (context, file, line, "\n".join(code)))
        result.write("----------------------------------------------------\n")        
    return result.getvalue()
1334933
public void printStackTrace(Throwable e, OutputStream os)
  {
    CharArrayWriter writer = new CharArrayWriter();
    PrintWriter pw = new PrintWriter(writer);
    
    e.printStackTrace(pw);

    pw.close();
    char []array = writer.toCharArray();

    CharBuffer cb = filter(array);

    if (os != null) {
      byte []b = cb.toString().getBytes();

      try {
        os.write(b, 0, b.length);
      } catch (IOException e1) {
      }
    } else
      System.out.println(cb);
  }
912004
public static StringBuilder createStackTrace(StringBuilder s, StackTraceElement[] stack) {
		if (stack != null)
			for (StackTraceElement e : stack) {
				s.append("\n\tat ");
				s.append(e.getClassName());
				if (e.getMethodName() != null) {
					s.append('.');
					s.append(e.getMethodName());
				}
				if (e.getFileName() != null) {
					s.append('(');
					s.append(e.getFileName());
					s.append(':');
					s.append(e.getLineNumber());
					s.append(')');
				}
			}
		return s;
	}
334248
public void printStackTrace(java.io.PrintWriter pw) {
        String lineSep = getLineSeparatorProperty();

        printText(pw, "currentException", "Current exception:");
        printStackTrace(lineSep, pw);
        printText(pw, "endOfExTraces", "End of exception traces");
    }
59091
public void printStackTrace(java.io.PrintWriter s) {

        if (s == null) {
            s = new java.io.PrintWriter(System.err, true);
        }

        try {
            String locInfo = getLocationAsString();

            if (null != locInfo) {
                s.println(locInfo);
            }

            super.printStackTrace(s);
        } catch (Throwable e) {}

        boolean isJdk14OrHigher = false;
        try {
            Throwable.class.getMethod("getCause", (Class<?>) null);
            isJdk14OrHigher = true;
        } catch (NoSuchMethodException nsme) {
            // do nothing
        }        

        // The printStackTrace method of the Throwable class in jdk 1.4 
        // and higher will include the cause when printing the backtrace.
        // The following code is only required when using jdk 1.3 or lower                
        if (!isJdk14OrHigher) {
            Throwable exception = getException();
    
            for (int i = 0; (i < 10) && (null != exception); i++) {
                s.println("---------");
    
                try {
                    if (exception instanceof DTMException) {
                        String locInfo =
                            ((DTMException) exception)
                                .getLocationAsString();
    
                        if (null != locInfo) {
                            s.println(locInfo);
                        }
                    }
    
                    exception.printStackTrace(s);
                } catch (Throwable e) {
                    s.println("Could not print stack trace...");
                }
    
                try {
                    Method meth =
                        ((Object) exception).getClass().getMethod("getException",
                            (Class<?>) null);
    
                    if (null != meth) {
                        Throwable prev = exception;
    
                        exception = (Throwable) meth.invoke(exception, (Class<?>) null);
    
                        if (prev == exception) {
                            break;
                        }
                    } else {
                        exception = null;
                    }
                } catch (InvocationTargetException ite) {
                    exception = null;
                } catch (IllegalAccessException iae) {
                    exception = null;
                } catch (NoSuchMethodException nsme) {
                    exception = null;
                }
            }
        }
    }
317542
public void printStackTrace(PrintWriter printWriter) {
    if (mStackTrace == null) {
      printWriter.print(getMessage());
    }
    else {
      printWriter.print(mStackTrace);
    }
  }
929200
public static String toShortString(Throwable e, int stackLevel) {
        StackTraceElement[] traces = e.getStackTrace();
        StringBuilder sb = new StringBuilder(1024);
        sb.append(e.toString()).append("\t");
        if (traces != null) {
            for (int i = 0; i < traces.length; i++) {
                if (i < stackLevel) {
                    sb.append("\tat ").append(traces[i]).append("\t");
                } else {
                    break;
                }
            }
        }
        return sb.toString();
    }
287390
public void printStack(long tid) throws IOException {
		System.out.printf("%n Stack trace of thread %d:%n", tid);

		ThreadInfo info = view.vmInfo.getThreadInfo(tid, 20);
		if (info == null) {
			System.err.println(" TID not exist:" + tid);
			return;
		}
		printSingleThread(info);
		System.out.flush();
	}
239958
def withTracebackPrint(ErrorType, thrownError, _traceback):
    ''''''
    file = StringIO.StringIO()
    traceback.print_exception(ErrorType, thrownError, _traceback, file = file)
    return _loadError(ErrorType, thrownError, file.getvalue())
1128486
public static void printStackTrace(final String message, final Logger logger, final LogLevel logLevel) {
        StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
        printStackTrace(message, Arrays.copyOfRange(stackTrace, 2, stackTrace.length), logger, logLevel);
    }
93252
@Override
    public void printStackTrace(PrintStream ps) {
        if ( getCause() != null ) {
            String superString = getLocalMessage();
            synchronized ( ps ) {
                ps.print(superString);
                ps.print((superString.endsWith(".") ?
                          " Caused by " : ". Caused by "));
                getCause().printStackTrace( ps );
            }
        } else {
            super.printStackTrace( ps );
        }
    }
1364696
public static String stackTraceToString(Throwable cause) {
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        PrintStream pout = new PrintStream(out);
        cause.printStackTrace(pout);
        pout.flush();
        try {
            return new String(out.toByteArray());
        } finally {
            try {
                out.close();
            } catch (IOException ignore) {
                // ignore as should never happen
            }
        }
    }
808801
public static void printFullStackTrace(PrintWriter out, ServletException e)
    {
        // determine the absolute root exception
        Throwable th = null;

        while (e != null)
        {
            th = e.getRootCause();

            if (th == null)
            {
                th = e;
                break;
            }
            else
                e = th instanceof ServletException ? (ServletException)th : null;
        }

        // now print the root exception
        try
        {
            // if th is a ServletErrorReport, it's already encoded...if not, encode it
            if (th instanceof ServletErrorReport)
                out.println("<HR width=\"100%\">\n" + th.getMessage() + "<BR>");
            else
                out.println("<HR width=\"100%\">\n" + encodeChars(th.getMessage())+ "<BR>");

            // print the stack trace to a string writer so we can encode it if necessary and format
            // its output
            StringWriter sw = new StringWriter();
            PrintWriter pw = new PrintWriter(sw);
            th.printStackTrace(pw);
            pw.flush();
            String traceOut;

            // if it's a ServletErrorReport, it's already encoded...if not, encode it
            if (th instanceof ServletErrorReport)
                traceOut = sw.toString();
            else
                traceOut = encodeChars(sw.toString());

            // split the stack lines so they'll appear right in the browser
            StringTokenizer st = new StringTokenizer(traceOut, "\n");

            while (st.hasMoreTokens())
            {
                out.println(st.nextToken());
                out.println("<BR>&nbsp;&nbsp;&nbsp;&nbsp;");
            }

            out.println("<BR>");
        }
        catch (EmptyStackException ex)
        {
          com.ibm.wsspi.webcontainer.util.FFDCWrapper.processException(ex, "com.ibm.ws.webcontainer.servlet.DefaultErrorReporter.printFullStackTrace", "158");
        }
    }
784582
public static void printFatal(Object caller, Object message)
	{
		
		StringBuilder text = new StringBuilder();

		Class<?> c = callerBuilder(caller, text);

		if(message instanceof Throwable)
			getLog(c).fatal(text.append(stackTrace((Throwable)message)));
		else
			getLog(c).fatal(text.append(message));

	}