mirror of
https://github.com/AxioDL/logvisor.git
synced 2025-12-08 13:15:09 +00:00
Added Win32 AllocConsole
This commit is contained in:
@@ -98,6 +98,13 @@ void RegisterConsoleLogger();
|
||||
*/
|
||||
void RegisterFileLogger(const char* filepath);
|
||||
|
||||
#if _WIN32
|
||||
/**
|
||||
* @brief Spawn an application-owned cmd.exe window for displaying console output
|
||||
*/
|
||||
void CreateWin32Console();
|
||||
#endif
|
||||
|
||||
#if LOG_UCS2
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
#define NOMINMAX
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#include <io.h>
|
||||
#include <fcntl.h>
|
||||
#else
|
||||
#include <sys/ioctl.h>
|
||||
#include <fcntl.h>
|
||||
@@ -297,6 +299,18 @@ void RegisterConsoleLogger()
|
||||
MainLoggers.emplace_back(new ConsoleLogger);
|
||||
}
|
||||
|
||||
#if _WIN32
|
||||
void CreateWin32Console()
|
||||
{
|
||||
/* Debug console */
|
||||
AllocConsole();
|
||||
|
||||
freopen("CONIN$", "r", stdin);
|
||||
freopen("CONOUT$", "w", stdout);
|
||||
freopen("CONOUT$", "w", stderr);
|
||||
}
|
||||
#endif
|
||||
|
||||
struct FileLogger : public ILogger
|
||||
{
|
||||
FILE* fp;
|
||||
|
||||
Reference in New Issue
Block a user