Add log colours because they are pretty (#237)

* log colours :)

* commend the freopen stuff (it causes problems)

* formatting

* add explanatory comment
This commit is contained in:
Jack 2022-08-23 22:50:21 +01:00 committed by GeckoEidechse
parent 09bc8a4ed2
commit a97f1f07bb
1 changed files with 6 additions and 3 deletions

View File

@ -234,9 +234,12 @@ void InitialiseLogging()
hExceptionFilter = AddVectoredExceptionHandler(TRUE, ExceptionFilter);
AllocConsole();
freopen("CONOUT$", "w", stdout);
freopen("CONOUT$", "w", stderr);
spdlog::default_logger()->set_pattern("[%H:%M:%S] [%l] %v");
// these two lines are responsible for stuff to not show up in the console sometimes, from talking about it on discord
// apparently they were meant to make logging work when using -northstar, however from testing it seems that it doesnt
// work regardless of these two lines
// freopen("CONOUT$", "w", stdout);
// freopen("CONOUT$", "w", stderr);
spdlog::default_logger()->set_pattern("[%H:%M:%S] [%^%l%$] %v");
SetConsoleCtrlHandler(ConsoleHandlerRoutine, true);
}