Author Topic: jPCT  (Read 2520 times)

Offline cyberkilla

  • float
  • ****
  • Posts: 413
    • View Profile
« on: January 31, 2007, 01:55:52 pm »
Egon, I use this piece of code to add an entire stack trace to the logs.

Perhaps you can find use for it in the official logger.

Code: [Select]

public static String getStackTrace(Throwable aThrowable)
   final Writer result           = new StringWriter();
   final PrintWriter printWriter = new PrintWriter(result);
   return result.toString();

To use this, I have a Logger.addError(Throwable e) method.
It just turns the stack trace into a string.

I cannot use the official logger, because I already had my own.

It is very useful for me, so I thought I'd share it. - Text Based MMORPG - 3D Isometric MMORPG