This commit is contained in:
Attila Uygun 2023-08-09 23:00:38 +02:00
parent 2ac1520c9b
commit eb50e547b8
1 changed files with 7 additions and 0 deletions

View File

@ -2,10 +2,13 @@
#if defined(__ANDROID__)
#include <android/log.h>
#elif defined(_WIN32)
#include <windows.h>
#else
#include <cstdio>
#endif
#include <cstdlib>
#include <format>
#include <string>
namespace base {
@ -38,6 +41,10 @@ LogMessage::~LogMessage() {
#if defined(__ANDROID__)
__android_log_print(ANDROID_LOG_ERROR, "kaliber", "%d [%s:%d] %s",
verbosity_level_, filename.c_str(), line_, text.c_str());
#elif defined(_WIN32)
std::string s = std::format("{} [{}:{}] {}", verbosity_level_,
filename.c_str(), line_, text.c_str());
OutputDebugStringA(s.c_str());
#else
printf("%d [%s:%d] %s", verbosity_level_, filename.c_str(), line_,
text.c_str());