点击错误日志自动定位到程序中(工具类)

public class PosinUtils {
	static final String TAG = "Posin.Utils";

	public static String getErrorInfoFromException(Exception e) {
		try {
			StringWriter sw = new StringWriter();
			PrintWriter pw = new PrintWriter(sw);
			e.printStackTrace(pw);
			return "\r\n" + sw.toString() + "\r\n";
		} catch (Exception e2) {
			return "bad getErrorInfoFromException";
		}
	}
	}

你可能感兴趣的:(错误日志自动定位)