diff --git a/src/main.cpp b/src/main.cpp index 170fdee..f680498 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -25,7 +25,20 @@ #include int main(int argc, char** argv) { - void* mutex_handle = CreateMutexW(nullptr, 0, L"MassBuilderSaveTool"); +#ifndef SAVETOOL_DEBUG_BUILD + std::ofstream output{"SaveToolLog.txt", std::ios::trunc|std::ios::out}; + + Utility::Debug d{&output}; + Utility::Warning w{&output}; + Utility::Error e{&output}; +#else + Utility::Warning w{Utility::Debug::defaultOutput()}; + Utility::Error e{Utility::Debug::defaultOutput()}; +#endif + + Utility::Debug{} << "===M.A.S.S. Builder Save Tool version " SAVETOOL_VERSION "==="; + + auto mutex_handle = CreateMutexW(nullptr, 0, L"MassBuilderSaveTool"); if(!mutex_handle) { SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Error initialising the app", @@ -39,14 +52,7 @@ int main(int argc, char** argv) { return EXIT_FAILURE; } -#ifndef SAVETOOL_DEBUG_BUILD - std::ofstream output{"SaveToolLog.txt", std::ios::trunc|std::ios::out}; - - Utility::Debug d{&output}; - Utility::Warning w{&output}; - Utility::Error e{&output}; -#endif - + Utility::Debug{} << "===Initialising OpenGL renderer==="; SaveTool app({argc, argv}); Int result = app.exec();