From b0affadd9a2ccbb01a30ba28810142881724f671 Mon Sep 17 00:00:00 2001 From: William JCM Date: Sun, 20 Jun 2021 13:39:43 +0200 Subject: [PATCH] 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... --- src/main.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 292b457..de9c86c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -16,4 +16,17 @@ #include "SaveTool/SaveTool.h" -MAGNUM_SDL2APPLICATION_MAIN(SaveTool) +#include + +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(); +}