diff --git a/include/Log.h b/include/Log.h index e633129..b82e55b 100644 --- a/include/Log.h +++ b/include/Log.h @@ -5,5 +5,5 @@ void Log(const char* prefix, const char* format, ...); #if _DEBUG #define LogDebug(...) Log("DEBUG: ", __VA_ARGS__) #else -#define LogDebug(...) (void) +#define LogDebug(...) #endif diff --git a/source/Log.cpp b/source/Log.cpp index b76121a..dfd2753 100644 --- a/source/Log.cpp +++ b/source/Log.cpp @@ -7,11 +7,13 @@ void Log(const char* prefix, const char* format, ...) { va_list args; + printf("%s", prefix); OutputDebugString(prefix); va_start(args, format); int count = _vscprintf(format, args); char* buffer = (char*)_alloca(count + 1); vsprintf_s(buffer, count + 1, format, args); OutputDebugString(buffer); + printf(buffer); va_end(args); } diff --git a/source/main.cpp b/source/main.cpp index 352168c..9d9d249 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -10,6 +10,7 @@ #include #include "Error.h" #include "SaveRestoreConsole.h" +#include "Log.h" using namespace std; @@ -25,6 +26,8 @@ static void DisplayHelp() int main(int argc, char** argv) { + LogDebug("main\n"); + #if defined(_DEBUG) _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); #endif