ITPub博客

首页 > 数据库 > 数据库开发技术 > 将printStackTrace转换为string

将printStackTrace转换为string

原创 数据库开发技术 作者:liang573728 时间:2019-05-30 20:06:05 0 删除 编辑
将printStackTrace转换为string[@more@]String s = null;try {
throw new Exception("An exception thrown!");
}
catch (Exception e) {
Writer w
= new StringWriter();
e.printStackTrace(
new PrintWriter(w));
s
= w.toString(); } System.out.println(s);

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/640706/viewspace-1044939/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: 安装perl package
请登录后发表评论 登录
全部评论

注册时间:2005-10-15

  • 博文量
    152
  • 访问量
    138340