main: improve logging.
This commit is contained in:
parent
14d75e0e83
commit
ef05c075ba
1 changed files with 15 additions and 9 deletions
24
src/main.cpp
24
src/main.cpp
|
@ -25,7 +25,20 @@
|
|||
#include <winerror.h>
|
||||
|
||||
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();
|
||||
|
||||
|
|
Loading…
Reference in a new issue