This commit is contained in:
Attila Uygun 2023-08-09 23:00:38 +02:00
parent f8df7d86f6
commit ba1e5cc681
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());