#include "blitz/misc/Log.h"

#if defined(__ANDROID__) and not defined(BLITZ_HEADLESS)
#define BLITZ_ANDROID_LOGGING
#endif

#ifdef BLITZ_ANDROID_LOGGING
#include <android/log.h>
#else
#include <iostream>
#endif

namespace blitz {
namespace utils {

void LOG(const std::string& msg) {
#ifdef BLITZ_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 BLITZ_ANDROID_LOGGING
	__android_log_print(ANDROID_LOG_ERROR, "TRACKERS", "%s", err.c_str());
#else
	std::cerr << err << "\n";
#endif
}

}  // namespace utils
}  // namespace blitz
