检索 Eclipse 控制台历史记录

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/37844798/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 23:12:31  来源:igfitidea点击:

Retrieving Eclipse console history

eclipse

提问by Yogesh Ghimire

Is there any way I can retrieve the Ecipseconsole log history? Whenever I run the program, does Eclipsecreate a log file and store somewhere? I have seen that we can manually create an outuput file, but what if I have not created one yet? Does Eclipsestore somewhere by default?

有什么办法可以检索Ecipse控制台日志历史记录吗?每当我运行该程序时,是否会Eclipse创建一个日志文件并存储在某处?我已经看到我们可以手动创建一个输出文件,但是如果我还没有创建一个怎么办?Eclipse默认情况下是否存储在某个地方?

回答by rfkortekaas

No, Eclipse doesn't store it by default. There are two options to enable this:

不,Eclipse 默认不存储它。有两个选项可以启用此功能:

The first method is to tell Eclipse to save console output to a file. For that, go to Run -> Debug Configurations on Eclipse menu. Then under "Standard Input and Output" section, click on checkbox next to "File:", and choose the name of output file to use. If you check "Append" underneath, console output will be appended to the output file. Otherwise, console output will be overwritten to the file.

第一种方法是告诉 Eclipse 将控制台输出保存到文件中。为此,请转到 Eclipse 菜单上的运行 -> 调试配置。然后在“标准输入和输出”部分下,单击“文件:”旁边的复选框,然后选择要使用的输出文件的名称。如果您选中下方的“附加”,控制台输出将被附加到输出文件中。否则,控制台输出将被覆盖到文件中。

The other way is to use explicit file logging from your application and store it anywhere you want.

另一种方法是使用应用程序中的显式文件日志记录并将其存储在您想要的任何位置。