-1
我有一个工具,这使得许多CERR输出。
如果我在在克利翁“运行配置” S运行它,我看到在输出窗口中的所有CERR消息。
如何禁用在克利翁/的IntelliJ一些输出流?
我用windows 10我如何可以禁用/忽略JetBrains的克利翁CERR输出流?
我有一个工具,这使得许多CERR输出。
如果我在在克利翁“运行配置” S运行它,我看到在输出窗口中的所有CERR消息。
如何禁用在克利翁/的IntelliJ一些输出流?
我用windows 10我如何可以禁用/忽略JetBrains的克利翁CERR输出流?
你应该重定向CERR输出到文件。
#include <iostream>
#include <fstream>
#include <string>
int main()
{
std::ofstream output("output.txt");
std::streambuf* p_cerrbuffer=std::cerr.rdbuf();
std::cerr.rdbuf(output.rdbuf()); // redirecting to a file
std::cout<<"cout"<<std::endl; // "cout" appears on the standard output.
std::cerr<<"cerr"<<std::endl; // "cerr" appears in the output.txt file
}
我的意思是不在代码中,但在IDE本身。 –
我肤浅。对不起!不幸的是我不知道JetBrains CLion。如果您从命令promt在Windows上运行应用程序,则以下语句可能会对您有所帮助:“applivcation.exe 2> file.txt”。按Enter键,cerr输出将重定向到file.txt。这个声明也创建了file.txt,你不必亲自去做。 –