We can log the stacktrace of a exception by using the following function to build the String:
// function to compose the stacktrace of a exception to a String
public static String getStackTrace(Throwable aThrowable) {
final Writer result = new StringWriter();
final PrintWriter printWriter = new PrintWriter(result);
aThrowable.printStackTrace(printWriter);
return result.toString();
}
Subscrever:
Enviar feedback (Atom)
Sem comentários:
Enviar um comentário