From c1ce8383aeadaa489afa9d61a67e03b76882a3f0 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Tue, 8 Sep 2020 15:52:39 -0700 Subject: [PATCH] Headless: Setup logman earlier. So we can control all the GPU init logging. --- headless/Headless.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/headless/Headless.cpp b/headless/Headless.cpp index 7f5e5fdcf4..284f709c02 100644 --- a/headless/Headless.cpp +++ b/headless/Headless.cpp @@ -328,14 +328,6 @@ int main(int argc, const char* argv[]) if (testFilenames.empty()) return printUsage(argv[0], argc <= 1 ? NULL : "No executables specified"); - HeadlessHost *headlessHost = getHost(gpuCore); - headlessHost->SetGraphicsCore(gpuCore); - host = headlessHost; - - std::string error_string; - GraphicsContext *graphicsContext = nullptr; - bool glWorking = host->InitGraphics(&error_string, &graphicsContext); - LogManager::Init(&g_Config.bEnableLogging); LogManager *logman = LogManager::GetInstance(); @@ -348,6 +340,14 @@ int main(int argc, const char* argv[]) } logman->AddListener(printfLogger); + HeadlessHost *headlessHost = getHost(gpuCore); + headlessHost->SetGraphicsCore(gpuCore); + host = headlessHost; + + std::string error_string; + GraphicsContext *graphicsContext = nullptr; + bool glWorking = host->InitGraphics(&error_string, &graphicsContext); + CoreParameter coreParameter; coreParameter.cpuCore = cpuCore; coreParameter.gpuCore = glWorking ? gpuCore : GPUCORE_NULL;