mirror of https://github.com/auygun/kaliber.git
win log
This commit is contained in:
parent
f8df7d86f6
commit
ba1e5cc681
|
@ -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());
|
||||
|
|
Loading…
Reference in New Issue