public static String convertFullStackTraceToString(Throwable e) {
StringWriter sw = new StringWriter();
e.printStackTrace(new PrintWriter(sw));
StringBuffer buff = sw.getBuffer();
int end = buff.length() <= stackTraceCharecterLimit ? buff.length() : stackTraceCharecterLimit;
return buff.substring(0, end).toString();
}
StringWriter sw = new StringWriter();
e.printStackTrace(new PrintWriter(sw));
StringBuffer buff = sw.getBuffer();
int end = buff.length() <= stackTraceCharecterLimit ? buff.length() : stackTraceCharecterLimit;
return buff.substring(0, end).toString();
}
No comments:
Post a Comment