mirror of
https://github.com/celisej567/mcpe.git
synced 2026-01-05 18:10:09 +03:00
* Use concrete log levels instead of prefixing the log string.
* Remove the "info" tag.
This commit is contained in:
@@ -5,30 +5,32 @@
|
||||
#include "LoggerWindows.hpp"
|
||||
#include "common/Util.hpp"
|
||||
|
||||
void LoggerWindows::print(const char* const str)
|
||||
void LoggerWindows::print(eLogLevel ll, const char* const str)
|
||||
{
|
||||
Logger::print(str);
|
||||
Logger::print(ll, str);
|
||||
|
||||
// wellp, this sucks, but it's fine
|
||||
OutputDebugStringA(GetTag(ll));
|
||||
OutputDebugStringA(str);
|
||||
OutputDebugStringA("\n");
|
||||
}
|
||||
|
||||
void LoggerWindows::print(std::string str)
|
||||
void LoggerWindows::print(eLogLevel ll, std::string str)
|
||||
{
|
||||
print(str.c_str());
|
||||
print(ll, str.c_str());
|
||||
}
|
||||
|
||||
void LoggerWindows::vprintf(const char* const fmt, va_list argPtr)
|
||||
void LoggerWindows::vprintf(eLogLevel ll, const char* const fmt, va_list argPtr)
|
||||
{
|
||||
print(Util::vformat(fmt, argPtr));
|
||||
print(ll, Util::vformat(fmt, argPtr));
|
||||
}
|
||||
|
||||
void LoggerWindows::printf(const char* const fmt, ...)
|
||||
void LoggerWindows::printf(eLogLevel ll, const char* const fmt, ...)
|
||||
{
|
||||
va_list argList;
|
||||
va_start(argList, fmt);
|
||||
|
||||
vprintf(fmt, argList);
|
||||
vprintf(ll, fmt, argList);
|
||||
|
||||
va_end(argList);
|
||||
}
|
||||
@@ -5,8 +5,8 @@
|
||||
|
||||
class LoggerWindows : Logger
|
||||
{
|
||||
void print(const char* const str) override;
|
||||
void print(std::string str) override;
|
||||
void vprintf(const char* const fmt, va_list argPtr) override;
|
||||
void printf(const char* const fmt, ...) override;
|
||||
void print(eLogLevel, const char* const str) override;
|
||||
void print(eLogLevel, std::string str) override;
|
||||
void vprintf(eLogLevel, const char* const fmt, va_list argPtr) override;
|
||||
void printf(eLogLevel, const char* const fmt, ...) override;
|
||||
};
|
||||
Reference in New Issue
Block a user