diff --git a/tests/D3D12/main.cpp b/tests/D3D12/main.cpp index d961e5b9..042e2382 100644 --- a/tests/D3D12/main.cpp +++ b/tests/D3D12/main.cpp @@ -30,8 +30,6 @@ using namespace XCEngine::Debug; #pragma comment(lib,"d3dcompiler.lib") #pragma comment(lib,"winmm.lib") -static FILE* gLogFile = nullptr; - void Log(const char* format, ...) { char buffer[1024]; va_list args; @@ -39,16 +37,7 @@ void Log(const char* format, ...) { vsnprintf(buffer, sizeof(buffer), format, args); va_end(args); - vprintf(format, args); - - if (gLogFile) { - va_start(args, format); - vfprintf(gLogFile, format, args); - va_end(args); - fflush(gLogFile); - } - - Logger::Get().Debug(LogCategory::General, buffer); + Logger::Get().Debug(LogCategory::Rendering, buffer); } //================================================================================= @@ -966,8 +955,6 @@ LRESULT CALLBACK WindowProc(HWND inHWND, UINT inMSG, WPARAM inWParam, LPARAM inL // 程序入口点 //================================================================================= int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int inShowCmd) { - fopen_s(&gLogFile, "D3D12_log.txt", "w"); - Logger::Get().AddSink(std::make_unique("D3D12_engine_log.txt")); Logger::Get().SetMinimumLevel(LogLevel::Debug); @@ -1154,9 +1141,6 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine } } } - if (gLogFile) { - fclose(gLogFile); - } Logger::Get().Shutdown(); return 0; }