lqxue

常用链接

统计

book

tools

最新评论

Print the Stack Trace of the Exception to a String

import java.io.PrintWriter;
import java.io.StringWriter;
public static String getStackTrace(Throwable t)
{
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw, true);
t.printStackTrace(pw);
pw.flush();
sw.flush();
return sw.toString();
}

posted on 2007-04-17 17:24 lqx 阅读(214) 评论(0)  编辑  收藏


只有注册用户登录后才能发表评论。


网站导航: