将Throwable转换为字符串描述的堆栈信息 @param throwable 异常信息
(Throwable throwable)
| 75 | * @param throwable 异常信息 |
| 76 | */ |
| 77 | public static String getStackTrace(Throwable throwable) { |
| 78 | final Writer result = new StringWriter(); |
| 79 | final PrintWriter printWriter = new PrintWriter(result); |
| 80 | throwable.printStackTrace(printWriter); |
| 81 | return result.toString(); |
| 82 | } |
| 83 | |
| 84 | /** |
| 85 | * JSON字符串格式化 |