I can disable all log from my app in release mode by set up qInstallMessageHandler
. But there are still some log from third party libraries that I used. Is there any way to disable all log to console without modify other libraries? Thanks
Just an idea, but you could stream to a file the cout
and cerr
streams.
#include <fstream>
#include <iostream>
int main(int argc, char *argv[]) {
std::ofstream file;
file.open("output.txt");
std::streambuf *std_buffer = std::cout.rdbuf();
std::cout.rdbuf(file.rdbuf());
std::cout << "this is a log" << std::endl;
return 0;
}