List of utility methods to do Log Exception
void | logException(String msg, Exception ex) Logs the specified message and exception to ./repast.log. BufferedWriter out; PrintWriter pOut = null; try { out = new BufferedWriter(new FileWriter("./repast.log")); pOut = new PrintWriter(out); pOut.println(msg); ex.printStackTrace(pOut); pOut.flush(); ... |
void | logException(Throwable t, Logger log, Level level) log Exception String msg = t.getMessage() + "\n" + backtraceToString(t);
log.log(level, msg);
|
void | logStackTrace(Logger log, Throwable e) Logs an entire stack trace to the logger, so that it can easily be viewed in the App Engine log. logStackTrace(log, Level.SEVERE, e); |
void | logStackTrace(Throwable e, Logger logger) log Stack Trace if (logger.isDebugEnabled()) { StringWriter sw = new StringWriter(); e.printStackTrace(new PrintWriter(sw)); logger.debug(COMMUNICATION, sw.toString()); |