mirror of https://github.com/AxioDL/logvisor.git
Added Win32 AllocConsole
This commit is contained in:
parent
189e047977
commit
4c2442df2d
|
@ -98,6 +98,13 @@ void RegisterConsoleLogger();
|
||||||
*/
|
*/
|
||||||
void RegisterFileLogger(const char* filepath);
|
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
|
#if LOG_UCS2
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -6,6 +6,8 @@
|
||||||
#define NOMINMAX
|
#define NOMINMAX
|
||||||
#endif
|
#endif
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
#include <io.h>
|
||||||
|
#include <fcntl.h>
|
||||||
#else
|
#else
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
@ -297,6 +299,18 @@ void RegisterConsoleLogger()
|
||||||
MainLoggers.emplace_back(new ConsoleLogger);
|
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
|
struct FileLogger : public ILogger
|
||||||
{
|
{
|
||||||
FILE* fp;
|
FILE* fp;
|
||||||
|
|
Loading…
Reference in New Issue