Files
Tower-Defense2/src/td/misc/Log.cpp

38 lines
618 B
C++

#include <td/misc/Log.h>
#ifdef TD_ANDROID_LOGGING
#include <android/log.h>
#else
#include <iostream>
#endif
namespace td {
namespace utils {
void LOG(const std::string& msg) {
#ifdef TD_ANDROID_LOGGING
__android_log_print(ANDROID_LOG_INFO, "TRACKERS", "%s", msg.c_str());
#else
std::cout << msg << "\n";
#endif
}
void LOGD(const std::string& msg) {
#if !defined(NDEBUG)
LOG(msg);
#endif
}
void LOGE(const std::string& err) {
#ifdef TD_ANDROID_LOGGING
__android_log_print(ANDROID_LOG_ERROR, "TRACKERS", "%s", err.c_str());
#else
std::cerr << err << "\n";
#endif
}
} // namespace utils
} // namespace td