Android 日志输出到本地txt

来源:互联网 发布:2017零售业数据分析 编辑:程序博客网 时间:2024/03/28 23:36

有时候Logcat日志过长,为了方便查看,我们可以把它存储到text文档。

 

String str = "hello world";try {FileWriter fw = new FileWriter(PATH + "/aa.txt");fw.flush();fw.write(str);fw.close();} catch (Exception e) {e.printStackTrace();}String str = "hello world";try {FileWriter fw = new FileWriter(PATH + "/aa.txt");fw.flush();fw.write(str);fw.close();} catch (Exception e) {e.printStackTrace();}