mirror of
https://github.com/celisej567/mcpe.git
synced 2026-09-17 20:10:23 +03:00
* Rename Logger_windows -> LoggerWindows
* Add logger support for SDL base
This commit is contained in:
34
platforms/windows/LoggerWindows.cpp
Normal file
34
platforms/windows/LoggerWindows.cpp
Normal file
@@ -0,0 +1,34 @@
|
||||
#include <iostream>
|
||||
#include <stdarg.h>
|
||||
#include <windows.h>
|
||||
|
||||
#include "LoggerWindows.hpp"
|
||||
#include "common/Util.hpp"
|
||||
|
||||
void LoggerWindows::print(const char* const str)
|
||||
{
|
||||
Logger::print(str);
|
||||
|
||||
OutputDebugStringA(str);
|
||||
OutputDebugStringA("\n");
|
||||
}
|
||||
|
||||
void LoggerWindows::print(std::string str)
|
||||
{
|
||||
print(str.c_str());
|
||||
}
|
||||
|
||||
void LoggerWindows::vprintf(const char* const fmt, va_list argPtr)
|
||||
{
|
||||
print(Util::vformat(fmt, argPtr));
|
||||
}
|
||||
|
||||
void LoggerWindows::printf(const char* const fmt, ...)
|
||||
{
|
||||
va_list argList;
|
||||
va_start(argList, fmt);
|
||||
|
||||
vprintf(fmt, argList);
|
||||
|
||||
va_end(argList);
|
||||
}
|
||||
Reference in New Issue
Block a user