mirror of https://github.com/auygun/kaliber.git
win log
This commit is contained in:
parent
2ac1520c9b
commit
eb50e547b8
|
@ -2,10 +2,13 @@
|
||||||
|
|
||||||
#if defined(__ANDROID__)
|
#if defined(__ANDROID__)
|
||||||
#include <android/log.h>
|
#include <android/log.h>
|
||||||
|
#elif defined(_WIN32)
|
||||||
|
#include <windows.h>
|
||||||
#else
|
#else
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#endif
|
#endif
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
#include <format>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace base {
|
namespace base {
|
||||||
|
@ -38,6 +41,10 @@ LogMessage::~LogMessage() {
|
||||||
#if defined(__ANDROID__)
|
#if defined(__ANDROID__)
|
||||||
__android_log_print(ANDROID_LOG_ERROR, "kaliber", "%d [%s:%d] %s",
|
__android_log_print(ANDROID_LOG_ERROR, "kaliber", "%d [%s:%d] %s",
|
||||||
verbosity_level_, filename.c_str(), line_, text.c_str());
|
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
|
#else
|
||||||
printf("%d [%s:%d] %s", verbosity_level_, filename.c_str(), line_,
|
printf("%d [%s:%d] %s", verbosity_level_, filename.c_str(), line_,
|
||||||
text.c_str());
|
text.c_str());
|
||||||
|
|
Loading…
Reference in New Issue