Add output redirection in release mode.

Debug mode gets outputted to std{out,err}. While most IDEs are sane
enough to capture the streams by default (hello, Qt Creator!), others
aren't (such as CLion, but there's a workaround there), and you can
forget about CMD output as well. Ugh, I hate Windows...
This commit is contained in:
Guillaume Jacquemin 2021-06-20 13:39:43 +02:00
parent 61d1e3635f
commit b0affadd9a
1 changed files with 14 additions and 1 deletions

View File

@ -16,4 +16,17 @@
#include "SaveTool/SaveTool.h"
MAGNUM_SDL2APPLICATION_MAIN(SaveTool)
#include <fstream>
int main(int argc, char** argv) {
#ifndef MANAGER_DEBUG_BUILD
std::ofstream output{"out.txt", std::ios::trunc|std::ios::out};
Utility::Debug d{&output};
Utility::Warning w{&output};
Utility::Error e{&output};
#endif
SaveTool app({argc, argv});
return app.exec();
}