This commit is contained in:
2022-07-14 13:08:20 +02:00
parent 2f1161959b
commit bbb84c0061
3 changed files with 39 additions and 0 deletions

View File

@@ -2,6 +2,9 @@
#include <cstdint>
// include Log for every files
#include "misc/Log.h"
namespace td {
namespace game {

15
include/misc/Log.h Normal file
View File

@@ -0,0 +1,15 @@
#pragma once
#include <string>
#ifndef NDEBUG
#define LOGD LOG
#endif
namespace td {
namespace utils {
void LOG(const std::string& msg);
} // namespace utils
} // namespace td

21
src/misc/Log.cpp Normal file
View File

@@ -0,0 +1,21 @@
#include "misc/Log.h"
#ifdef __ANDROID__
#include <android/log.h>
#else
#include <iostream>
#endif
namespace td {
namespace utils {
void LOG(const std::string& msg){
#ifdef __ANDROID__
__android_log_print(ANDROID_LOG_INFO, "TRACKERS", "%s", msg);
#else
std::cout << msg << "\n";
#endif
}
}
} // namespace td