add log
This commit is contained in:
@@ -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
15
include/misc/Log.h
Normal 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
21
src/misc/Log.cpp
Normal 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
|
||||
Reference in New Issue
Block a user