/**
* 异常信息工具类
*/
public class ExceptionUtils {
/**
* 获取异常信息
* @param ex
* @return
*/
public static String getExceptionMessage(Exception ex) {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
ex.printStackTrace(pw);
return sw.toString();
}
}
java PrintWriter 打印错误日志
最新推荐文章于 2025-07-21 10:18:49 发布