/** * Read the stacktrace of the supplied {@link Throwable} into a String. */ public static String readStackTrace(Throwable throwable) { Preconditions.notNull(throwable, "Throwable must not be null"); StringWriter stringWriter = new StringWriter(); try (PrintWriter printWriter = new PrintWriter(stringWriter)) { throwable.printStackTrace(printWriter); } return stringWriter.toString(); }
异常的日志的输出,堆栈里面的异常信息输出
最新推荐文章于 2024-10-01 09:29:45 发布