有时候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();
}
本文介绍了一种将Logcat日志保存为文本文件的方法,通过简单的代码实现,便于开发者离线查阅和分析日志信息。
有时候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();
}
410
5258
7208
7033

被折叠的 条评论
为什么被折叠?