* 得到異常信息
*
* @param e
*/
public void errorInfo(Exception e) {
ByteArrayOutputStream buf = new ByteArrayOutputStream();
e.printStackTrace(new PrintWriter(buf, true));
String expMessage = buf.toString();
err(expMessage);
}
//將異常內容輸出到文件
public void logError( Exception ex ) throws IOException
{
File log = new File( "log.txt" );
DataOutputStream dos = new DataOutputStream( new FileOutputStream( log ) );
ex.printStackTrace( new PrintStream( dos ) );
dos.flush();
..............
}