12345678910111213141516171819202122232425 |
- #pragma once
-
- #if APP_CORE_LOGS
-
- #define APP_CORE_LOGS_LEVEL 1
-
- #define LOG(level_, ...) do { \
- if (level_ <= APP_CORE_LOGS_LEVEL) \
- { \
- char tmp[100]; \
- snprintf(tmp, sizeof(tmp), __VA_ARGS__); \
- Serial.println(tmp); \
- } \
- } while (0)
-
- #define LOG_FN_BEGIN(level_) LOG(level_, "%s: Begin", __FUNCTION__)
- #define LOG_FN_END(level_) LOG(level_, "%s: End", __FUNCTION__)
-
- #else
-
- #define LOG(...)
- #define LOG_FN_BEGIN(level_)
- #define LOG_FN_END(level_)
-
- #endif
|