declare packets + commands

This commit is contained in:
2024-10-13 15:30:57 +02:00
parent 77317df56c
commit 0354ce776b
18 changed files with 461 additions and 273 deletions

37
src/td/misc/Log.cpp Normal file
View File

@@ -0,0 +1,37 @@
#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